Wat is er fout?
Code (php)
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
if(isset($_POST['submit'])) {
$id = $_POST['id'];
$title = $_POST['title'];
$story = $_POST['content'];
$query1 = "UPDATE title, content
SET ".$title.", ".$story."
WHERE id=".$id.""
mysql_query($query1) or die('Error, query failed');
}
$id = $_POST['id'];
$title = $_POST['title'];
$story = $_POST['content'];
$query1 = "UPDATE title, content
SET ".$title.", ".$story."
WHERE id=".$id.""
mysql_query($query1) or die('Error, query failed');
}
Parse error: syntax error, unexpected T_STRING in C:\wamp\www\asdada\acp\index.php on line 147
Hier is de code er om heen:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
query = " SELECT * FROM ".$lol." " .
"ORDER BY id DESC LIMIT $offset, $rowsPerPage";
$result = mysql_query($query) or die('Error, query failed');
while($row = mysql_fetch_array($result))
{
if($_GET['lol'] == "edithome"){
echo("<form method='post'>
<input type='hidden' name='id' value='".$row['id']."'>".$row['id']."</input>
<input type='text' name='title' size='102' value='".$row['title']."'></input><br />
<textarea cols='73' rows='2' name='content'>".$row['content']."</textarea><br />
<input type='submit' value='Edit' name='submit'></input>
</form><br />");
} else if($_GET['lol'] == "editabout"){
$lol = "about";
} else if($_GET['lol'] == "editgfx"){
$lol = "gfx";
} else if($_GET['lol'] == "editlinks"){
$lol = "links";
} else if($_GET['lol'] == "addnews"){
$lol = "home";
} else if($_GET['lol'] == "addabout"){
$lol = "about";
} else if($_GET['lol'] == "addgfx"){
$lol = "gfx";
} else if($_GET['lol'] == "addlinks"){
$lol = "links";
}
}
if(isset($_POST['submit'])) {
$id = $_POST['id'];
$title = $_POST['title'];
$story = $_POST['content'];
$query1 = "UPDATE title, content
SET ".$title.", ".$story."
WHERE id=".$id.""
mysql_query($query1) or die('Error, query failed');
}
$query2 = "SELECT COUNT(id) AS numrows FROM $lol";
$result = mysql_query($query2) or die('Error, query failed');
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$numrows = $row['numrows'];
$maxPage = ceil($numrows/$rowsPerPage);
$self = $_SERVER['PHP_SELF'];
"ORDER BY id DESC LIMIT $offset, $rowsPerPage";
$result = mysql_query($query) or die('Error, query failed');
while($row = mysql_fetch_array($result))
{
if($_GET['lol'] == "edithome"){
echo("<form method='post'>
<input type='hidden' name='id' value='".$row['id']."'>".$row['id']."</input>
<input type='text' name='title' size='102' value='".$row['title']."'></input><br />
<textarea cols='73' rows='2' name='content'>".$row['content']."</textarea><br />
<input type='submit' value='Edit' name='submit'></input>
</form><br />");
} else if($_GET['lol'] == "editabout"){
$lol = "about";
} else if($_GET['lol'] == "editgfx"){
$lol = "gfx";
} else if($_GET['lol'] == "editlinks"){
$lol = "links";
} else if($_GET['lol'] == "addnews"){
$lol = "home";
} else if($_GET['lol'] == "addabout"){
$lol = "about";
} else if($_GET['lol'] == "addgfx"){
$lol = "gfx";
} else if($_GET['lol'] == "addlinks"){
$lol = "links";
}
}
if(isset($_POST['submit'])) {
$id = $_POST['id'];
$title = $_POST['title'];
$story = $_POST['content'];
$query1 = "UPDATE title, content
SET ".$title.", ".$story."
WHERE id=".$id.""
mysql_query($query1) or die('Error, query failed');
}
$query2 = "SELECT COUNT(id) AS numrows FROM $lol";
$result = mysql_query($query2) or die('Error, query failed');
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$numrows = $row['numrows'];
$maxPage = ceil($numrows/$rowsPerPage);
$self = $_SERVER['PHP_SELF'];
Gewijzigd op 01/01/1970 01:00:00 door Stefan Candan
Query lijkt nergens op.
Miss moet iemand daar maar (nog) eens een tut over schrijven, dat de mensen eens leren hoe dat je die fouten moet afhandelen