PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
carbine
Forum Newbie
Posts: 6 Joined: Mon Mar 14, 2005 6:37 am
Post
by carbine » Tue Mar 15, 2005 9:58 am
Trying to update my database using the following line of code, though nothing seems to be happening. Any suggestions as to why not? Thanks
Code: Select all
$userid="cs";
$sql=mysql_query("UPDATE test SET forename = 'Micko' WHERE userid = $userid");
CoderGoblin
DevNet Resident
Posts: 1425 Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany
Post
by CoderGoblin » Tue Mar 15, 2005 10:01 am
Include debugging information into your script and you should find it easier to track down problems like this....
Code: Select all
$userid="cs";
$sql=mysql_query("UPDATE test SET forename = 'Micko' WHERE userid = '$userid'");
$userid is a string so SQL needs single quotes around it.