My SQL not getting row
| From: | Ben Houlton | Date: | Wed, 11 Jun 2003 05:31:29 +0000 |
| Subject: | My SQL not getting row | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-151016@lists.php.net to get a copy of this message | ||
The bit of my code that I'm working on is here:
if ($submit) {
if ($id) {
$sql = "UPDATE pages SET sub='$sub'
msg='$msg',name='$name',email='$email',newday='$newday'
WHERE id=$id";
} else {
$sql = "INSERT INTO pages (sub,msg,name,email,date,time,newday) VALUES
('$sub','$msg','$name','$email','$date','$time','$newday')";
}
$sql = "SELECT * FROM pages WHERE id=$id";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
printf("Record updated/edited!<p>Return to <A
href=\"index.php?id=%s\">Index</a>", $myrow["id"]);
}
I want to make it so when I click submit for adding a new entry, The
"Return" link returns to the fresh entry. But it's just comming up with
http://localhost/index.php?id= (no number after the id=
I've been trying for
ever and I'm not getting anywhere :-(
Any help would be appreciated
Thank You for your time.
-Ben