heres the deal, i got this script to add a user to the database (i have other scripts to login n stuff) but the problem is it deletes the original recold and writes over it, being a complete plonker i can’t fix it please help!!!
<?php include("connect2db.php"); $qselect = "Select * from members where id = '1'"; $qadd = " INSERT INTO members (id, password, username) VALUES ('1', 'test', 'test') "; $qupdate = " UPDATE members SET password = '$password', username = '$username' WHERE id = '1'"; $result = mysql_query($qselect); // check the single record exists if (mysql_num_rows($result)) $result = mysql_query($qupdate); // add record else $result = mysql_query($qadd); // if not add an initial record if ($result) mysql_close(); else { echo "ERROR - unable to save new username and password!"; $SQLError = "SQL ERROR: ".mysql_errno().". ".mysql_error()."
"; echo "$SQLError"; mysql_close(); } include("addauser.php"); ?>
Any idea’s?