Code works fine with XAMPP but not on server

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Code works fine with XAMPP but not on server

Postby FishMA » 17. December 2009 04:31

I am working on a site that uses a mysql database on remote server. I have been using xammp as a testing server and the follow code works just fine with xampp.

Code: Select all
if (isset($_SESSION['MM_Username'])){
$ID = $_SESSION['MM_Username'];
  $query  = "SELECT Email_address FROM individuals WHERE ID='$ID'" or die(mysql_error());
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)){
    $email = $row['Email_address'];
}
if (is_null($email)){
header ("Location: login_activate_warning.php");
exit;
}
}


But when I transfer everything to the server, it does not work and I receive the following error message.

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in ... on line 41.


Line 41 is:

Code: Select all
while($row = mysql_fetch_assoc($result)){


I am baffled. Any suggestions or explainations as why it works with xampp but not on the server?
FishMA
 
Posts: 5
Joined: 17. December 2009 04:27

Re: Code works fine with XAMPP but not on server

Postby FishMA » 17. December 2009 06:37

No need to responsed, I found my own dumb mistake.
FishMA
 
Posts: 5
Joined: 17. December 2009 04:27


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 127 guests