Aero2004
January 29th, 2005, 07:58 PM
Hiii
I got a problem in my php application, the problem is the same code can run in one server (lycos.co.uk) but cannot run in another server using PHP 4.3.9 and MySQL 4.0.22-standard...
Below is the code:
1 <?
2 $user = $_POST['user'];
3 $password = $_POST['password'];
4
5 include "db.inc.php";
6$query = "select * from pwdtable
7 where user = '$user'";
8
9$result = mysql_query($query);
10
11while ($row = mysql_fetch_row($result)) {
12 if ($password == $row[1]) {
13 session_start();
14 $user_session = $password;
15 session_register("user_session");
16 header("location:main.php");
17 }
18}
19
20echo("Login fails");
21?>
and the error tat i got is
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/eugene2/public_html/ben/checkid.php on line 12
Thank you in advance... Really frustrating becoz i tink my code is correct...
Really appreciate if anyone can kindly tell me wats wrong...
I got a problem in my php application, the problem is the same code can run in one server (lycos.co.uk) but cannot run in another server using PHP 4.3.9 and MySQL 4.0.22-standard...
Below is the code:
1 <?
2 $user = $_POST['user'];
3 $password = $_POST['password'];
4
5 include "db.inc.php";
6$query = "select * from pwdtable
7 where user = '$user'";
8
9$result = mysql_query($query);
10
11while ($row = mysql_fetch_row($result)) {
12 if ($password == $row[1]) {
13 session_start();
14 $user_session = $password;
15 session_register("user_session");
16 header("location:main.php");
17 }
18}
19
20echo("Login fails");
21?>
and the error tat i got is
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/eugene2/public_html/ben/checkid.php on line 12
Thank you in advance... Really frustrating becoz i tink my code is correct...
Really appreciate if anyone can kindly tell me wats wrong...