jkewlo Posted March 20, 2008 Author Share Posted March 20, 2008 when i display the data with <? session_start(); $email = @$_POST['email']; $password = @$_POST['password']; $conn = new COM('ADODB.Connection') or die('Could not make conn'); $rs = new COM('ADODB.Recordset') or die('Coult not make rs'); $connstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\\wamp\\www\\pro\\project\\Rainwater.mdb"; $conn->Open($connstring); if (!$conn) {exit("Connection Failed: " . $conn);} $sql="SELECT email, password FROM sign WHERE email = '$email' AND password = '$password' "; $rs->Open($sql, $conn); if(odbc_num_rows($rs) != 1){ echo "". $email ." & ". $password .""; } ?> i get Warning: odbc_num_rows(): supplied argument is not a valid ODBC result resource in C:\wamp\www\pro\project\check.php on line 22 yuki_mimilam@hotmail.com & 123 as a error but as u can see it is printing the email and password what would be the odbc way of getting the num_rows? i just need to make a log in page work. anything would be good as long as it checks against the email and password. please need help running out of time Quote Link to comment Share on other sites More sharing options...
jkewlo Posted March 20, 2008 Author Share Posted March 20, 2008 gawd finially got it. for future reference <? session_start(); $email = @$_POST['email']; $password = @$_POST['password']; $conn = new COM('ADODB.Connection') or die('Could not make conn'); $rs = new COM('ADODB.Recordset') or die('Coult not make rs'); $connstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\\wamp\\www\\pro\\project\\Rainwater.mdb"; $conn->Open($connstring); if (!$conn) {exit("Connection Failed: " . $conn);} $sql="SELECT email, password FROM sign WHERE email = '$email' AND password = '$password' "; $rs->Open($sql, $conn); if (!$rs->EOF) { if ( $rs->Fields["email"]->value && $rs->Fields["email"]->value == $email && $rs->Fields["Password"]->value && $rs->Fields["Password"]->value == $password ) { $_SESSION["auth"] = $email; // Relocate to the logged-in page header("Location: profile.php"); } } else { $_SESSION["message"] = "login Error as $email. " ; header("Location: sign_in.php"); } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.