Jump to content

HELP - simple problem i'm sure, but stuck.


babinm

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.