Jump to content

Recommended Posts

$query  = "UPDATE ('$keyarray['item_name'.$i]')||'_'||('$keyarray['option_selection2_'.$i]') SET AdvertiserID=('$_SESSION['username']') WHERE AdvertiserID='0' AND Day=('$keyarray['option_selection1_'.$i]') AND ('$keyarray['option_selection2_'.$i])_Id=('$randNums')";

 

($randNums is an array)

 

in english after all the paypal variables pass through i would like it to read...

UPDATE January_Ad1 SET AdvertiserID=(the user logged in) WHERE AdvertiserID='0' AND Day=1 AND Ad1_Id=(the random numbers that were generated before the query)

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/86509-whats-wrong-with-this-query/
Share on other sites

Whenever you put variables in double-quoted string, enclose them in curly brackets, like so:

$audience = 'World';
echo "Hello, {$audience}!";

 

If you're having trouble with your query, echo it before you send it to the DB:

echo $query;

Is it what you expected?

 

If it looks like it is, execute it with a die() statement:

mysql_query($query) or die(echo 'Error: ' . mysql_error());

 

You didn't specify what you did to trouble shoot the problem, so I have to assume you didn't do anything.  Programs don't fix themselves, programmers have to trouble shoot them.  When something stops working in your house, a light bulb for example, do you just stare at it blankly and give up?  Or do you try and figure out why?  Same thing with debugging. ;)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.