babinm Posted January 28, 2009 Share Posted January 28, 2009 Here is my code: if($targets=="") { echo "targets is empty. "; $query=""; $targets="content.php?page_id=".$_SESSION['article_ID']; echo "<br />target is: ".$targets; $sql_update="UPDATE items SET target='".$targets."' WHERE item_ID=".$_SESSION['article_ID']; echo $sql_update; $query=mysql_query($sql_update)or die(mysql_error()); echo $query; } The output i'm being presented with (due to my echo's to find the error) is: targets is empty target is: content.php?page_id=14 UPDATE items SET target='content.php?page_id=14' WHERE item_ID=14 1 __________________________ Nothing runs after this. No error is produced. It is not updating my table. I can't understand it. If i run the query manually through database and copy and paste the SQL it runs fine, but through PHP it's not working. HELP... Link to comment https://forums.phpfreaks.com/topic/142834-help-simple-problem-im-sure-but-stuck/ Share on other sites More sharing options...
Ayon Posted January 28, 2009 Share Posted January 28, 2009 try this $sql_update="UPDATE items SET target='".$targets."' WHERE item_ID='".$_SESSION['article_ID']."'"; Link to comment https://forums.phpfreaks.com/topic/142834-help-simple-problem-im-sure-but-stuck/#findComment-748726 Share on other sites More sharing options...
babinm Posted January 28, 2009 Author Share Posted January 28, 2009 Problem solved - was writing over the update afterwards in a different piece of code. Link to comment https://forums.phpfreaks.com/topic/142834-help-simple-problem-im-sure-but-stuck/#findComment-748729 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.