...

View Full Version : Error



Kev0121
03-08-2009, 04:24 PM
Heres my error!


Omg!
Notice: Undefined index: id in C:\wamp\www\tests\index.php on line 19
Edit
Last Night...
Notice: Undefined index: id in C:\wamp\www\tests\index.php on line 19
Edit
Woot
Notice: Undefined index: id in C:\wamp\www\tests\index.php on line 19
Edit
Omg!
Notice: Undefined index: id in C:\wamp\www\tests\index.php on line 19
Edit
Omg!
Notice: Undefined index: id in C:\wamp\www\tests\index.php on line 19
Edit

Heres my code




<?php
include 'connection.php';
?>

<html>
<head>
<title>Testing</title>
</head>
<body>
<?php
$q = "SELECT * FROM `test`";
$qinfo = mysql_query($q);


while($post = mysql_fetch_array($qinfo)) {

echo "<div id=\"postinfo\">";
echo $post['title'];
echo "<a hrer=\"edit.php?id=$_GET[id]\">Edit</a>";
echo "</div>";
}
?>
</body>
</html>


Kevin

abduraooft
03-08-2009, 04:27 PM
echo "<a hrer=\"edit.php?id=$_GET[id]\">Edit</a>"; I think you need

echo "<a hrer=\"edit.php?id={$post['id']}\">Edit</a>"; there.

PS: validate your code (http://validator.w3.org/#validate_by_input) and fix all errors in your markup.

Kev0121
03-08-2009, 05:10 PM
Thanks alot it works and thanks for the site very helpfull :)

Kevin



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum