Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Comments for: nasser20030219.php3

Message # 1015518:
Date: 02/21/03 12:32
By: kev
Subject: Good GD use, poor SQL practice!

Hi,

nice intro to GD... and the results is there, working fine. However, although this is no an article concerning databases, the code used for accessing the db is quite poor. First the design of the DB could be improved (what is the point of having a "voteoptions" table if you still use hard coded values in the "poll" table?). Second thing, if the poll system gets populare, the database and this script are gonna suffer! mysql_num_rows works fine, but a good all SELECT COUNT(id) saves a lot of processing to the DBMS. And the use of mysql_fetch_object() for instance would save some lines of code as well as some processing on the php part...

Previous Message | Next Message


Comments:
dont forget the last line (top of page2)steve05/02/05 18:46
Just a small thing to keep an eye onAmitabh Kant09/25/04 09:17
RE: Good GD exampleTran PHuoc Long12/19/03 10:18
Good GD exampleRupa08/14/03 05:46
RE: Why don't youandy06/30/03 03:31
even easier....Roger02/27/03 17:42
Why don't youRob02/21/03 13:41
Good GD use, poor SQL practice!kev02/21/03 12:32
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.