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!
1. Why do mysql_fetch_array($resource,MYSQL_ASSOC) when you can just use mysql_fetch_assoc($resource)?
2. You have no checking to make sure that the query will actually return something before trying to use it.
3. If you have more than one Primary Key, you won't get past the first row, as you are not looping through results.
4. $key['KEYS'] (at least on my server) is not a valid field. When I tried the SHOW KEYS statement on one of my tables, I received the following fields:
| Table
| Non_unique
| Key_name
| Seq_in_index
| Column_name
| Collation
| Cardinality
| Sub_part
| Packed
| Null
| Index_type
| Comment
here is the full code i got working now incase anyone finds it useful. if you find a way to shorten it please feel free to share for everyone's benifit