Simple Problem I'm Sure - Dead Stuck and Deadline SOON
Posted: Wed Jan 28, 2009 12:41 pm
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...
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...