hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : nested mysql queries using C
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

nested mysql queries using C

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 01-20-2004, 01:03 PM
Slidey Slidey is offline
Web Hosting Master
 
Join Date: Apr 2003
Location: UK
Posts: 2,560

nested mysql queries using C


Hi,

has anyone got any examples of the above?

ive got 2 tables in a database, and im using info from one to refer to the other..

so we select uid from table1, then select * from table2 where uid=uidfromtable1

but the second query doesnt return anything..

really winding me up!

anyone?

cheers

Slidey

Reply With Quote


Sponsored Links
  #2  
Old 01-20-2004, 06:31 PM
Sheps Sheps is offline
Community Guide
 
Join Date: Dec 2002
Location: The Shadows
Posts: 2,900
SELECT * FROM table1 LEFT JOIN table2 ON table1.uid=table2.uid;

Try that, I think that is what you are looking for... If they are both primary keys, then you won't have any duplicates. I tested this out on a few simple tables.

__________________
Dan Sheppard ~ Freelance whatever

Reply With Quote
  #3  
Old 01-20-2004, 07:24 PM
Slidey Slidey is offline
Web Hosting Master
 
Join Date: Apr 2003
Location: UK
Posts: 2,560
i twigged (or a mate did!) that i could combine the two queries, so thats worked now..

tomorrow gotta see about implementing the rest to see if that will work. bit of a wasted day really!

cheers

Reply With Quote
Sponsored Links
Reply

Related posts from TheWhir.com
Title Type Date Posted
Web Host Rackspace Launches Private Beta for MySQL Cloud Database Web Hosting News 2011-12-01 21:09:51
Parallels Now Offering Licenses for CloudLinux OS Web Hosting News 2011-10-26 17:29:25
Web Hosting Sales and Promos Roundup - October 7, 2011 Web Hosting News 2011-10-07 19:56:18
Web Hosting Software Firm CloudLinux Releases CloudLinux OS Version 6.1 Web Hosting News 2011-09-13 14:08:49
Web Host FireHost Partners with Cloud Security Firm Gazzang for Data Encryption Web Hosting News 2011-08-16 20:33:43


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?