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

Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I

Passing Arguments to execlp()
I'm writing a program that mimics a unix shell. It's supposed to take commands with arguments and ex

Passing JS to PHP
So I have the following
Code: <?php
getdetails(?><script type="text/

if else problem, help please
i have this script that i made only i try to also put in a if else for for some reason the script is

progress bar...need expert opinion of experienced webmaster
Hey guys, quick question:

I want to display a progress bar when I upload files, but I am not

How do I replace any number of character occurences with one occurrence?
How do I replace any number of character occurences with one occurrence?

Let's say I have:

Namespace Problem
I'm having problem with a section of code with a variable namespace.

This code works fine:

mysql_query returning boolean instead of mysql ressource
Hi,

I seem to have a weird issue with the php command mysql_query. I pass 2 arguments the que

PHP MySQL Return Results Issue
Hi guys,

I'm running joomla and made a module which is using ajax.
Basically i just have a

Add trigger to UpdatePanel programmatically
Hi,I'm working on a website which uses AJAX and Masterpages. What I have is an AJAX UpdatePanel whi

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