Presto-X Posted June 24, 2007 Share Posted June 24, 2007 Can any one see any reson whey this would not work? if ($_GET['session'] == 'updating'){$query = "UPDATE zen_blogs SET title='$title', content='$content' WHERE id = '$blogid')";} I can get INSERT INTO and DELETE FROM to work just fine but for some reason I can not update the table and it's starting to drive me nuts. Here is some more code to give a better idea of what I'm trying to do. @mysql_connect($hostname, $username, $password) or die("ERROR--CAN'T CONNECT TO SERVER"); @mysql_select_db($database) or die("ERROR--CAN'T CONNECT TO DATABASE"); $blogid=$_GET["blogid"]; $title=$_POST["title"]; $date=$_POST["date"]; $content=$_POST["content"]; if ($_GET['session'] == 'saving'){$query = "INSERT INTO `zen_blogs` VALUES('','$title','$date','$content')";} if ($_GET['session'] == 'updating'){$query = "UPDATE `zen_blogs` SET title='$title', content='$content' WHERE `id` = '$blogid')";} if ($_GET['session'] == 'deleting'){$query = "DELETE FROM `zen_blogs` WHERE `id` = '$blogid'";} mysql_query($query); Link to comment https://forums.phpfreaks.com/topic/57007-solved-query-update-not-working-for-me-at-all/ Share on other sites More sharing options...
trq Posted June 24, 2007 Share Posted June 24, 2007 Remove the ) just after '$blogid'. Link to comment https://forums.phpfreaks.com/topic/57007-solved-query-update-not-working-for-me-at-all/#findComment-281591 Share on other sites More sharing options...
Presto-X Posted June 24, 2007 Author Share Posted June 24, 2007 AHHHHHH Thanks thorpe, I have been up for way to logn working on this lol I do not know how I mist that lol Thanks for the help. Link to comment https://forums.phpfreaks.com/topic/57007-solved-query-update-not-working-for-me-at-all/#findComment-281592 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.