View Single Post
Old 06-24-2009, 07:28 AM   #2 (permalink)
Hightower
The Acquainted
 
Hightower's Avatar
 
Join Date: May 2009
Location: Durham, UK
Posts: 134
Thanks: 9
Hightower is on a distinguished road
Default

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

__________________
Hightower's Softpolio
Send a message via MSN to Hightower
Hightower is offline  
Reply With Quote