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:

Did you know?Explore Trending and Topic pages for more stories like this.
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

Breaking results into week blocks
I have a set of dates (and times), which are returned from a mySQL query.

These usually span

Sorting JTable on more than just the values listed in the columns
I have a collection of objects that store (among other things) two integer values. I only want to di

$_FILES array
Ok,

I just started experimenting with PHP today. My goal right now is to have people be able

Map.php
I am a complete beginner to PHP and am looking for some help with a program I am messing around with

rookie looking for help coding a CSS form with PHP
I'm trying to figure out how to add PHP code to my xhtml form so that it is a working form embedded

b+ tree
Hi
can every body help me about b+ tree ?(insert & delete)

array_diff weirdness
I'm using the following bit of code

$diff = array_diff($pids, $pidlist);
$diff = array_va

why does my session end?
my connect.php starts the session just so you know
i can navigate arround my site fine except whe

cyrillic string conversion question
Hello,

First time here...

I would like to know if there is a way to convert a

Different actions for different parts of a string
<?php
function dosomething($string, $else = '') {
if (empty($else))
$string

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