TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   [question]Get info From multiple rows (http://www.talkphp.com/general/1223-question-get-info-multiple-rows.html)

Tozzie 09-25-2007 02:15 AM

[question]Get info From multiple rows
 
Hey guys :)
i was wondering if i could get some help, im currently working on a tutorial script , and i want to display tutorial listing from multiple "sub-categories".
See whati ive got set up is sub categories under photoshop, So basically i want to display all the tutorials that make up the photoshop category.
like this:
Code:

"SELECT * FROM tutorials WHERE category = 'Drawing Effects Forum Signatures General Design Photo Effects Special Effects Text Tips & Tricks Web Design"
But i know that wont work,
i've tried this too:
Code:

"SELECT * FROM tutorials WHERE category IN ('Drawing, Effects, Forum Signatures, General Design, Photo Effects, Special Effects, Text, Tips & Tricks, Web Design)"
I would love to get any help :)

Thanks in advance! :)

-Tozzie

mortisimus 09-25-2007 07:26 AM

So I'm guessing that you want a sql query, try this:

Code:

SELECT * FROM tutorials WHERE `tutorials`.`catagory` = 'photoshop'
Should work...

Salathe 09-25-2007 09:42 AM

Change:
SELECT * FROM tutorials WHERE category IN ('Drawing, Effects, Forum Signatures, General Design, Photo Effects, Special Effects, Text, Tips & Tricks, Web Design)

To:
SELECT * FROM tutorials WHERE category IN ('Drawing', 'Effects', 'Forum Signatures', 'General Design', 'Photo Effects', 'Special Effects', 'Text', 'Tips & Tricks', 'Web Design')


If we knew your table structures, there'd likely be a much easier SQL query that we could use. But the above should work from what you've provided so far.

Tozzie 09-25-2007 09:30 PM

Quote:

Originally Posted by Salathe (Post 2585)
Change:
SELECT * FROM tutorials WHERE category IN ('Drawing, Effects, Forum Signatures, General Design, Photo Effects, Special Effects, Text, Tips & Tricks, Web Design)

To:
SELECT * FROM tutorials WHERE category IN ('Drawing', 'Effects', 'Forum Signatures', 'General Design', 'Photo Effects', 'Special Effects', 'Text', 'Tips & Tricks', 'Web Design')


If we knew your table structures, there'd likely be a much easier SQL query that we could use. But the above should work from what you've provided so far.

:D thanks! that worked perfectly :)


All times are GMT. The time now is 08:51 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0