TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-01-2011, 03:01 PM   #1 (permalink)
The Visitor
 
Join Date: Jul 2011
Posts: 1
Thanks: 0
RallanToo is on a distinguished road
Default Newbie SQL Query problem?

Hi

I'm new at this, so bear with me

I'm trying the following query in PHP with MySQL:

$sqlFull = "SELECT feed_items.id AS feedID, store_products.id AS storeID";
$sqlFull .= " FROM store_products";
$sqlFull .= " FULL JOIN feed_items";
$sqlFull .= " ON master_item_id=feed_items.id";

If I run it like that then I get an error:
Unknown column 'store_products.id' in 'field list'

If I change "store_products.id" to just "id" it says:
Column 'id' in field list is ambiguous

Help?
RallanToo is offline  
Reply With Quote
Old 07-05-2011, 12:59 PM   #2 (permalink)
The Wanderer
 
Join Date: May 2010
Posts: 19
Thanks: 1
core1024 is on a distinguished road
Default

PHP Code:
$sqlFull .= " FROM store_products";
$sqlFull .= " FULL JOIN feed_items"
Here if you see the word "FULL" means nothing but alias of store_products so either remove this word or change "store_products.id" to "FULL.id"
core1024 is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL comma problem vpopp MySQL & Databases 16 01-29-2013 12:27 PM
Problem executing MSSQL query in PHP trmbne2000 MySQL & Databases 2 06-30-2009 02:52 PM
Problem with mysql_real_escape_string() ETbyrne Advanced PHP Programming 0 12-17-2008 10:39 PM
Problem with Query + While $a = mysql_fetch_array($b) Aaron Absolute Beginners 0 07-03-2008 07:16 PM
SQL Query?? Tanax Absolute Beginners 11 11-21-2007 06:45 PM


All times are GMT. The time now is 10:45 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design