Webmaster Forum Rules | Posting Guide | Contact Us | Testimonials | Contributing Geek Program | Advertise on Geek/Talk
Welcome to the GeekTalk Webmaster Discussion Forums from GeekVillage.com

Click Here To Register. It's Free!

Go Back   geek/talk: Signature-free discourse for serious web publishers > YOUR CREATION: Building & Maintaining A Web Site > Web Development - Programming / Coding
User Name
Password
Register FAQ Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 09-30-2001, 11:27 AM   #1
pk
Registered User
 
pk's Avatar
 
Join Date: Nov 2000
Location: Toronto, Ontario
Posts: 209
Default mysql HELP!

hi

How can i combine these 2 statements into one?

PHP Code:
select linkID from linkcat where cat='cars'
this will give me this
----------
|linkID|
|12 |
|1 |

PHP Code:
select title from links where linkID=12
will give me
----------
title
---------
|great cars|

can i combine those 2 statements? so that i will select all titles where cat='cars'?


I tried this
PHP Code:
select links.title from linkcat,links where linkcat.cat='cars'
but it didn't work. It just showed me all records
pk is offline   Reply With Quote
Old 10-01-2001, 01:58 AM   #2
JohnKelly
Registered User
 
Join Date: Aug 2001
Posts: 53
Default

Not sure of your table structure but based on what you wrote you might try something like the following ...

SELECT linkcat.linkID, links.title FROM linkcat, links WHERE linkcat.linkID = links.linkID AND linkcat.cat = 'cars';
JohnKelly is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL installation problems. b2gdotcom Web Development - Programming / Coding 3 11-29-2001 03:00 AM
Tip for heavy MySQL users: CREATE INDEX demae Web Hosting Discussion 4 05-15-2001 04:32 PM
vBullletin - Corrupted MySQL records! Steve_S Web Design and Webmaster Issues 5 02-06-2001 11:44 PM
mysql overload? notibrian Web Design and Webmaster Issues 0 02-01-2001 08:03 PM
mysql help kris Web Design and Webmaster Issues 3 01-01-2001 06:18 PM

Please support our advertisers. They ensure our survival.

All times are GMT -5. The time now is 07:41 PM.


GeekVillage.com is copyright © 1998-2013 iOnline Pty Ltd. All rights reserved.
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.