hi thanks for that
i went to get a drink and watched some tv..i did not touch th e pc at all..when i came back the phpmyadmin was working???? bizzare as before i left it it wasnt...no restart nothing...
anyway my loggin problem still exists
here is the code
<?
session_start();
session_register("StudentID_session");
?>
<? // asp2php (vbscript) converted
?>
<?
if (empty($_POST["EmailAddress"]))
{
//first time entering page
$TheMessage="To sign in fill in your details below and click on the Teacher to enter.";
}
else
{
//check that user exists and login is correct
// $conn is of type "adodb.connection"
$username = "chris";
$password = "astra123";
$hostname = "localhost";
$dbh = @mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
print "Connected to MySQL
";
$selected = @mysql_select_db("phptest",$dbh)
or die("Could not select phptest");
// you're going to do lots more here soon
mysql_close($dbh);
$RSStudent=$RSStudent_query=@mysql_query(("SELECT StudentID FROM mmstudents where StudentEmailAddress = '"
.$_POST["EmailAddress"]."' and StudentPassword = '"
.$_POST["Password"]."'"),$conn);
$RSStudent=@mysql_fetch_array($RSStudent_query);
if (($RSStudent==0))
{
//invalid login
$TheMessage="Student not found. Re enter the correct email and password.";
}
else
{
//valid entry
$StudentID_session=$RSStudent["StudentID"];
header("Location: "."student_menu.php");
}
}
?>
when i enter correct login details the page returns with "connected to mysql" in the top left hand corner...however it also returns the message (in bold above) student not found!!! i have tripple checked the details ive entered are correct... yet it says they are not ie student not found.....
the page is acting as it was designed to ie if an incorrect detail is entered then the page returns on itself.. yet i am entering the correct email and password! the database servername password are all correct mysql server is running myphpadmin is working fine..test pages created with phpmyadmin on the database are working fine..i can add delete etc from the browser window...what seems to evade me is to connect to the database from the page code above....even though all the details are correct and working in other php pages..
bizzare
any help would be appreciated cheers
chris
the new and extreemly p/o php student