sk121506 Posted January 17, 2008 Share Posted January 17, 2008 $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. Quote Link to comment https://forums.phpfreaks.com/topic/86509-whats-wrong-with-this-query/ Share on other sites More sharing options...
roopurt18 Posted January 17, 2008 Share Posted January 17, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/86509-whats-wrong-with-this-query/#findComment-442059 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.