mlmorg
07-17-2007, 09:26 PM
Hi all,
I'm very new to php mysql but have been learning from http://www.freewebmasterhelp.com/tutorials/phpmysql/1
I have set up a web page and my home page (the one that displays what is in my database) works nicely; however, my edit page does not work unless I specify the exact id number I want to edit. Even though there's currently only one row in my database, if I have:
$query="SELECT * FROM home WHERE id='$id'";
on my edit page, the page doesn't display; however, if I do:
$query="SELECT * FROM home WHERE id='1'";
It works. The page I'm working on http://www.katherinewagnerdesigns.com/test/guilford/index.php is set up with two "posts". One titled "Movies in the Park," the other "Annual Flea Market and Crafts Fair." Since I just started learning php mysql, only the first post uses php (the second one html for now). The edit page, http://www.katherinewagnerdesigns.com/test/guilford/edit.php right now is set up with id=1 but I would like to have it so the edit page has every post on it, with the ability to add new posts and edit/delete old ones. So, it seems that this problem I'm having will stop me from being able to do this unless I can get it to work and auto-increment down the page each successive id post.
I hope this makes sense to everyone...sorry I'm still learning this. Thanks for any help anyone can give me. Matt
I'm very new to php mysql but have been learning from http://www.freewebmasterhelp.com/tutorials/phpmysql/1
I have set up a web page and my home page (the one that displays what is in my database) works nicely; however, my edit page does not work unless I specify the exact id number I want to edit. Even though there's currently only one row in my database, if I have:
$query="SELECT * FROM home WHERE id='$id'";
on my edit page, the page doesn't display; however, if I do:
$query="SELECT * FROM home WHERE id='1'";
It works. The page I'm working on http://www.katherinewagnerdesigns.com/test/guilford/index.php is set up with two "posts". One titled "Movies in the Park," the other "Annual Flea Market and Crafts Fair." Since I just started learning php mysql, only the first post uses php (the second one html for now). The edit page, http://www.katherinewagnerdesigns.com/test/guilford/edit.php right now is set up with id=1 but I would like to have it so the edit page has every post on it, with the ability to add new posts and edit/delete old ones. So, it seems that this problem I'm having will stop me from being able to do this unless I can get it to work and auto-increment down the page each successive id post.
I hope this makes sense to everyone...sorry I'm still learning this. Thanks for any help anyone can give me. Matt