Hey all!
I am running my php codes on IIS 5.1, and have recently built a website which is working without a problem on my computer. But after i uploaded my pages to my web hoster, i started receiving these errors when i try to login;
=======================
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ...
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in ...
=======================
and here is the code
DataStore.php
<?php
$db = mysql_connect("localhost", "myuid", "mypwd") or die("Error: mysql_connect failed!");
mysql_select_db("Textile", $db);
?>
Login.php
<?php include 'DataStore.php';
//get data from login form
$Email = strtolower($POST['Email']);
$Password = strtolower($POST['Password']);
// connect to database
$sql = "SELECT * FROM Textile WHERE Email = '$Email'";
$result = mysql_query($sql,$db);
$row = mysql_fetch_array($result);
$num_rows = mysql_num_rows($result);
// verify email is registered
If($num_rows == 0){
header("Location:ErrorFiles/LogFail.htm");
} elseif ($Password != $row["Password"]){
header("Location:ErrorFiles/LogFailPass.htm");
} else {
session_start();
session_register("Email");
}
?>
and when i use
$result = mysql_query($sql,$db) or die mysql_error();
i receieve an error like this;
Parse error: parse error, unexpected T_STRING in /.........../Login.php on line 9
I have been searching the net in order to find an answer, however none of the suggestions was a remedy...
(The server is running php 4.2 on apache)
Please help or i will start losing all my hair!
Kindest regards...