06-24-2009, 07:28 AM
|
#2 (permalink)
|
|
The Acquainted
Join Date: May 2009
Location: Durham, UK
Posts: 134
Thanks: 9
|
I think (off the top of my head) I've always done this with two seperate statements. Not sure if it's the best way but it does work. Something like:
PHP Code:
$r = mysqli_query("SELECT * FROM db WHERE username='$u' LIMIT 1"); $rows = mysqli_num_rows($r); if($rows == 0) { // 0 means user doesn't already exist //Put the new user details into the database }
|
|
|