Join Query Help


Posted on 16th Feb 2014 07:03 pm by admin

Hi all,

I am having problems with the below code, which we shall call 'my first join query'! Suprise suprise its not working and I am getting an error I have not seen before:

QuoteParse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:wampwwwstockluckpagesstockpage.php
The code is:

Code: [Select]$querybuy=" SELECT users_stocks.bank, stocks.t_val
FROM users_stocks, stocks
WHERE user_id = ' . $_SESSION['user_id'] .'
AND stock_id = '$stock_id'";

$result = mysql_query($querybuy) or die(mysql_error());
and the parse error is referring to this line:
QuoteWHERE user_id = ' . $_SESSION['user_id'] .'
What I am doing wrong?

No comments posted yet

Your Answer:

Login to answer
202 Like 23 Dislike
Previous forums Next forums
Other forums

Shuffle between users ??
I have multiple $users in table. I need to send them $message.

I need to send the next messag

Check premium expire
Hi,

I am making a simple file hosting site and want to check if users premium subscriptions h

Array to string conversion
Can anyone help me with this?

Notice: Array to string conversion in /home/..../index.php on l

Blank record injected into database
I always found several blank records inside my database, although $SESSION is required to insert the

please hep to get values from a table row
can anyone tel me how I can select and get data from one row by pressing an Edit button in that row

How to secure my login data to my database?
Hi there,

It may be a stupid question but I don't know how to secure my login data to my data

db entry based on primary key
My "topics" table contains 10 entires
*--------------*
topicid topic
------

Show message after entering data
Hello Colleagues

I would like to display messages after entering the data example: "
dat

MySQL-PHP Query Results Help
Hello all. I'm hoping to be able to get some help in solving a problem with query/rowcount output. I

Error with Font and imagettfbbox
I keep getting an error that says "Warning: imagettfbbox() [function.imagettfbbox]: Could not f

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash