Jump to content

Moving a DB from MySQL 4.1.20 to 5.0.27 gives script failure


rookie_sql

Recommended Posts

Hi,

 

I moved a database from one server to another the differnce being the original server is running MySQl 4.1.20 and the new server is running 5.0.27. When I run the script on the new server I get:

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/vhosts/xxxx.com/httpdocs/project.php on line 8

 

If I run the script on the new server and point the DB connection back to the old server it works fine. So I'm guessing there's something different between the two versions that's causing the error. Here's the code I using:

 

<?session_start(void);

//connection info

include "includes/globalVars.inc.php";

//connect to the database

$database = mysql_connect($mysql_hostname,$mysql_username, $mysql_password);

mysql_select_db($mysql_database, $database);$query1 = "SELECT PP.*, P.*, PC.* FROM  projects P, projectCategory PC left outer join projectPhoto PP on PP.projectId = P.projectId WHERE P.projectId = '$projectId' AND P.projectCategory = PC.categoryId ORDER BY PP.photoOrder ASC";

$result = mysql_db_query ("$mysql_database",$query1);

if ($row = mysql_fetch_array ($result))

{

$projectId = $row[projectId];

$categoryId = $row[categoryId];

$category = $row[categoryName];

$subCategory = $row[subCategoryName];

$projectName = $row[projectName];

$projectBuilding = $row[projectBuilding];

$projectName = $row[projectName];

$photoSRC = $row[photoSRC];

$projectSummary = $row[projectSummary];

$projectAwards = $row[projectAwards];

}

$query1 = "SELECT projectId FROM projects WHERE projectCategory = '$categoryId' ORDER BY projectOrder";$result = mysql_db_query ("$mysql_database",$query1);$count=1;

while ($row = mysql_fetch_array ($result))

{

$testId = $row[projectId];

if ($next && !$nextId){$nextId = $testId;

}

if ($testId == $projectId)

{

$next = true; $hit = true;

 

}

if (!$hit){$previousId = $testId;}$count++;

}

?>

 

Can anyone tell me what the problem might be? Thanks!!

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.