evillazydwarf
Programmer
Hi guys,
apologies if this is something silly i'm still quite new to MySQL so here goes...
the user fills out this form to sign up to the website, the form checks the database to see if the username has already been taken with the code:
i then try to count the rows using:
and get DEATH every time, i tried using mysql_error() but it doesn't out put anything??
i'm not sure whether this is an error with my code or an error with my server, any input would be very helpful.
Thanks
Ben
apologies if this is something silly i'm still quite new to MySQL so here goes...
the user fills out this form to sign up to the website, the form checks the database to see if the username has already been taken with the code:
Code:
$conn = mysql_connect("localhost:3306", "root", "********")
or die ("Error With Connection");
echo("connected<br><br>");
$db_sel = mysql_select_db("game",$conn)
or die ("Error With Database");
$check = "select * from users where 'username' = '$username'";
$db_sel = mysql_query($check,$conn)
or die (mysql_error());
i then try to count the rows using:
Code:
$num = mysql_num_rows($db_sel) or die ('DEATH');
and get DEATH every time, i tried using mysql_error() but it doesn't out put anything??
i'm not sure whether this is an error with my code or an error with my server, any input would be very helpful.
Thanks
Ben