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!
Ok, here's my problem.
I want the visitor to be able to update the kind of paper, and how many in quantity of a photo. But sometimes it'll do it, sometimes it'll get ignored. I do want it to ignore the mysql_query but only when 3 cols are the same. Here's my code:
1. Move the database selection outside the loop. You don't need to reselect the same database every time you query.
2. You probably want to escape the output of the prints with htmlentities
3. Make sure you escape the db parameters using mysql_real_escape_string
4. Instead of checking the item if it changed, I would recommend blindly performing the update. Because there are less queries involved, it's faster and simpler
Any of these four things could be causing the problem, or it could be something else. I can't really tell until you isolate the problem. Until then, fix these issues, and it may fix itself.
Ambush Commander wrote:Several things that should be done:
1. Move the database selection outside the loop. You don't need to reselect the same database every time you query.
2. You probably want to escape the output of the prints with htmlentities
3. Make sure you escape the db parameters using mysql_real_escape_string
4. Instead of checking the item if it changed, I would recommend blindly performing the update. Because there are less queries involved, it's faster and simpler
Any of these four things could be causing the problem, or it could be something else. I can't really tell until you isolate the problem. Until then, fix these issues, and it may fix itself.