not conecting to database
Posted: Thu Jul 28, 2005 4:04 pm
how can i make something that will conect to mysql database?
when you sign up it seems like its connected but it dosent, then when you sign in it says "Name and password not found or not matched"
the code for "make.php"
the code for "getin.php"
what should i do to make it connect?
when you sign up it seems like its connected but it dosent, then when you sign in it says "Name and password not found or not matched"
the code for "make.php"
Code: Select all
<?
$conn = mysql_connect("e;localhost"e;,"e;gaogier"e;,"e;*********"e;);
$db = mysql_select_db("e;gaogier_javelincontrols"e;);
$username = $_POSTї"e;username"e;];
$password = $_POSTї"e;password"e;];
$email = $_POSTї"e;email"e;];
$result= MYSQL_QUERY("e;INSERT INTO users (id, username, password, email)"e;.
"e;VALUES ('NULL', '$username', '$password', '$email')"e;);
echo "e;Your name and password have been submitted into our database :)"e;;
?>Code: Select all
<?
$conn = mysql_connect("e;localhost"e;,"e;gaogier"e;,"e;*******"e;);
$db = mysql_select_db("e;gaogier_javelincontrols"e;);
$username = $_POSTї"e;username"e;];
$password = $_POSTї"e;password"e;];
$result = MYSQL_QUERY("e;SELECT * from users WHERE username='$username'and password='$password'"e;)
or die ("e;Name and password not found or not matched"e;);
$worked = mysql_fetch_array($result);
$username = $workedїusername];
$password = $workedїpassword];
$email = $workedїemail];
if($worked)
echo "e;Welcome $user! Your e-mail address is $email"e;;
?>what should i do to make it connect?