pls tel me what is wrong i am doing here...?
Table name: tutor
form value:email,password
i am getting email and password from a form and want to store that in a database named "nikitah_tbd"
but the following codes shows error....
ple help...
<?php
$dbh=mysql_connect ("localhost", "teacher", "mypasswd") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("nikitah_tbd");
if (!$dbh) {
echo( "<P>Unable to connect to the " .
"database server at this time.</P>" );
exit();
}
// Select the jokes database
if (! @mysql_select_db("nikitah_tbd") ) {
echo( "<P>Unable to locate the TUITIONBD " .
"database at this time.</P>" );
exit();
}
// If a email and pass is given
// add it to the database.
$sql = "INSERT INTO tutor SET".
"email='$email', " .
"paswd='$password';"
if (mysql_query($sql)) {
echo("<P>Your E-mail address has been added</P>");
} else {
echo("<P>Error adding submitted email " .
mysql_error() . "</P>");
}
?>