i need to ask

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

User avatar
puckeye
Forum Contributor
Posts: 105
Joined: Fri Dec 06, 2002 7:26 pm
Location: Joliette, QC, CA
Contact:

Post by puckeye »

Actually WHERE 1 returns everything in the table.

It's like using if (1) {} in PHP, this if would always execute it's internal block because 1 is always TRUE.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

and instead of using MYSQL_ASSOC like this:

Code: Select all

while ($row = mysql_fetch_array($res,MYSQL_ASSOC)) {
you can use mysql_fetch_assoc() like so:

Code: Select all

while ($row = mysql_fetch_assoc($res)) {
Mac

Oh and I really can't help myself, just have to say - FrontPage, urgh.
Post Reply