This is a fairly simple question. Basically, I’m having a program send HardWare ID’s to my PHP script as GET data. I need the PHP script check to make sure that HardWare ID is in a specific MySQL column, and if it is, { continue the script, } else { exit(); }
Problem is I’m not too good with MySQL and have no idea how to do this. However, I feel that I should know this by now, so if someone could also link me to a good tutorial site for MySQL, that kind of keeps it “humanized” if you know what I mean. One that “dumbs it down.” I’m not dumb or anything, I just get sidetracked easily, and if all its doing is showing me code and not explaining it, I won’t pick it up. If you don’t have any tutorial sites off the top of your head, I’ll settle for help with the first question, and try to hunt down a tutorial later.
EDIT: It was noted that it may help to see how my database is set up.
I have a table called “hwids”
In this table there are 3 columns: “id” “hwid” and “paypal”
(They buy the program from me, I add their HWID to the database so they can use the program. If they chargeback and try to scam me, I can easily check which HWID is assigned for the paypal that did a chargeback, and remove it from the system via a management page)
When I started learning PHP/MySQL, I really liked the books that O’Reilly publishes on the subject. You may want to check out Learning PHP, MySql, and Javascript. The official sites for PHP and MySql provide a lot of good links and information, as well as documentation. Tizag has a useful tutorial.
To answer your question a little, you could do a select query that checks if the number of rows found is greater than zero. i.e.: