Log in

View Full Version : checking mysql row - if blank ok - if some value block



?foru
10-29-2008, 02:26 AM
I've written suspicious ip's to a database and checked against mySQL to prevent access to a site, so that's not a problem.

I have a little different scenario with another system.

When a user registers a confirmation code is written to the database along with the IP. The confirmation code is removed from the database when the user clicks the confirmation link in their email and the IP stays.

I need something to check the confimation row to see if it's blank which is ok and if something is there (non-confirmed) block it...

SELECT confirmation FROM users where confirmation NOT SURE WHAT GOES HERE
ex. of table in db w/ confirmation and IP fields

confirmation ------ IP
----------------------------
1. gpeohljd -- 11.222.33.444
2. ---------- 22.333.44.555

so in this example 2 is ok because it doesn't have a confirmation code, but 1 needs to be blocked since there is still a confirmation code.

Any help would be appreciated