14-05-2006, 17:00
|
|
|
חבר מתאריך: 19.11.05
הודעות: 615
|
|
בעיה עם התחברות קטנה משהו בספירת נתונים
קוד PHP:
<? session_start(); include('../include/config.php'); ?> <html dir="rtl"> <head> <meta http-equiv="Content-Language" content="he"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1255"> <title>New Page 1</title> </head> <body> <? $submit = $_POST['submit']; $admin = $_POST['admin']; $pass = $_POST['pass']; if($submit == true || $admin == true || $pass == true) { $query = mysql_query("SELECT admin,pass FROM admin WHERE admin == '".$admin."' and pass == '".$pass."'"); $co = mysql_num_rows($query); if($co == 0) { echo "נסה שוב"; }else{ $_SESSION["admin"] = $admin; echo "שלום לך $_SESSION[admin]"; } }else{ echo " <form method='POST' action=''> <table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='100%' id='AutoNumber1'> <tr> <td width='50%'> <p align='center'>שם האדמין:</td> <td width='50%'> <input type='text' name='admin' size='20'></td> </tr> <tr> <td width='50%'> <p align='center'>סיסמה:</td> <td width='50%'> <input type='text' name='pass' size='20'></td> </tr> <tr> <td width='50%'> <p align='center'>התחבר</td> <td width='50%'> <input type='submit' name='submit' value='התחבר'></td> </tr> </table> </form> "; } ?> </body> </html>
זה הקוד
עכשיו זה כותב לי בעיה עם הmysql_num_rows
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/php/domains/php.megart.co.il/public_html/port/admin/login.php on line 18
עכשיו כל הפרטים מהמסד וזה נכונים
אז מה הבעיה??
|