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 09-25-2007, 02:15 AM   #1 (permalink)
The Wanderer
 
Join Date: Sep 2007
Posts: 8
Thanks: 0
Tozzie is on a distinguished road
[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
Tozzie is offline  
Reply With Quote
Old 09-25-2007, 07:26 AM   #2 (permalink)
The Contributor
 
mortisimus's Avatar
 
Join Date: Sep 2007
Location: London, UK
Posts: 47
Thanks: 4
mortisimus is on a distinguished road
Default

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

Code:
SELECT * FROM tutorials WHERE `tutorials`.`catagory` = 'photoshop'
Should work...
mortisimus is offline  
Reply With Quote
Old 09-25-2007, 09:42 AM   #3 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

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.
Salathe is offline  
Reply With Quote
Old 09-25-2007, 09:30 PM   #4 (permalink)
The Wanderer
 
Join Date: Sep 2007
Posts: 8
Thanks: 0
Tozzie is on a distinguished road
Default

Quote:
Originally Posted by Salathe View Post
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 :)
Tozzie 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


All times are GMT. The time now is 04:23 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