On Wed, 2007-04-11 at 20:12 -0500, Richard Lynch wrote: > On Wed, April 11, 2007 12:53 pm, siavash1979@xxxxxxxxx wrote: > > Quoting Robert Cummings <robert@xxxxxxxxxxxxx>: > > > >> On Wed, 2007-04-11 at 09:59 -0700, siavash1979@xxxxxxxxx wrote: > >> > 1- your mysql query statement is better to have a WHERE part too. > >> > 2- I would use mysql_fetch_row instead of mysql_fetch_assoc > >> > >> Ummm, why would you want to reduce clarity and maintainability by > >> using > >> mysql_fetch_row()? > > > > hmmm, I just remember in my php class a while back, my teacher didn't > > even > > bother teaching us about mysql_fetch_assoc, and when a student asked > > about it, > > he said don't bother using it, just use mysql_fetch_row so I ended up > > using this > > function ever since. I'm guessing he was wrong?? > > He wasn't "wrong" > > It's a religious question. > > I find mysql_fetch_assoc to be less clear because you end up not > necessarily using the data until much later, and by the time you get > to the line that has: > > $row['foozie'] > > in it, you've lost track of what 'foozie' is... I'd rather lose track of $row['foozie'] than $row[1]. Either way, if your code is structured well, the row data should be in close proximity to it's use. At the very least, if your field names are informative instead of 'foozie', maybe 'email' then I think you'll have less trouble remembering. This isn't really a religious issue... it's a clarity issue. I mean, why bother naming variables if you think you might get confused later. Just call your vars $foo1 to $fooX-- at least that's the path you've laid out as an argument. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php