Needing A helping hand :)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chips
Forum Newbie
Posts: 4
Joined: Fri Mar 07, 2008 11:07 pm

Needing A helping hand :)

Post by chips »

all I would like to know is:

Code: Select all

" . DB_PREFIX . "users WHERE user_id=" .  [color=#FF0000]$user_id[/color]  $item_details['owner_id']);
How could I put $user_id in there without getting an error?


Thanks.
chips
Forum Newbie
Posts: 4
Joined: Fri Mar 07, 2008 11:07 pm

Re: Needing A helping hand :)

Post by chips »

anyone?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Needing A helping hand :)

Post by Christopher »

I could guess a . or , depending on whatever the heck is going on around in that code sub-snippet. What should the SQL statement look like? Are they parameters in a function call?
(#10850)
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Re: Needing A helping hand :)

Post by Rovas »

From the sample you given: instead of:
chips wrote:all I would like to know is:

Code: Select all

" . DB_PREFIX . "users WHERE user_id=" .  [color=#FF0000]$user_id[/color]  $item_details['owner_id']);
use

Code: Select all

. DB_PREFIX . "users WHERE user_id=" .[color=#FF0000]$user_id[/color]  ." AND [i]column name[/i]=" .$item_details['owner_id']);
Post Reply