Query Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
QbertsBrother
Forum Commoner
Posts: 58
Joined: Thu Oct 11, 2007 10:12 am

Query Question

Post by QbertsBrother »

so i have a question about some things when i make a query.

i am doing something like this.

i make a query. then i do a while loop to output some data from the database. inside the while loop i make another query based on a result from my first query. and i may do that a couple of times.

now it works great for what i need to do my main question is. is it bad practice to do something like that?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Query Question

Post by Christopher »

Look into doing JOINs so you only need to do one query. Search and you will find lots of information on the web.
(#10850)
Post Reply