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!
I'm tearing my head of... I can't find the error...
I have a db table with alot of records. They all have a unique id (sponsor_id) but uid can be there several of times and so can the hole, but only once can the uid and hole be example uid=25 hole=1. Now what I want is to look through the script and look for a certain combination of uid and hole, and if it exists print out "ID FOUND". If it doesnt exist this combo it should go to the next line "NO ID FOUND". Everytime I run this script it shows "ID FOUND" even though the combo doesnt exists... Where do I go wrong?
will always evaluate to true. I'm not exactly sure what you wish to compare here. If you wish to determine if the current row has a sponser_id that is greater than 0, you can try:
You can simply just use the following peice of code.
All it does is decide if the $id is anything other than 0. If the $id is not 0 then echo the $id. If on the other hand $id equals 0 then echo no id found
You just posted this question yesterday and I gave you an answer, to which you didn't respond. If you want more advice, fine, but don't open up a new thread, just continue posting in the old one.