[PHP-DB] Re: Speed Up Code?

2002-03-25 Thread Lutz Brückner
Hi Jeff, the most important rule you should follow: don't query the database in a loop to avoid a join! The following lines (maybe some changes are necesary) will do the same job as your code, but considerable faster. Especially if 'id' is an index in both tables. Lutz $sql = 'SELECT u.id,

RE: [PHP-DB] Re: Speed Up Code?

2002-03-25 Thread Jeff Oien
Fantastic! I'm going to have to study the code more to really understand it. Thanks for the help. I had to change the code just a little for it to work: $sql = SELECT u.id, u.username, u.album_title, date_format(MAX(f.date), '%b %D, %Y') as date1, COUNT(*) AS cnt FROM Chart_Users AS u INNER