PHP Strange error "0:". Possible Object syntax problem?
Posted
by Michael Stone
on Stack Overflow
See other posts from Stack Overflow
or by Michael Stone
Published on 2010-04-29T17:18:18Z
Indexed on
2010/04/29
18:27 UTC
Read the original article
Hit count: 284
I'm trying to transfer a site from one hosting company to another. I was using 000webhost until the client had hosting and a domain. Now that the client has their domain and hosting, using FatCow.com, I can not for the life of me, debug my PHP code. I'm not getting any errors. I have a successful DB connection. If you procedurally display data, it works, but when I try to use my original objects, something is breaking and just returns "0:". I have all errors on.
On old server where the site worked:
PHP Version 5.2.11
MySQL Version: 5.0.81
On new server where I get the "0:":
PHP Version 5.2.12
MySQL Version 5.0.32
I've setup a test page to test just the output of the variables with the DB connection.
Below is my code:
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
try
{
$link = mysql_connect('connectionstring', 'username', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
else{
$db = mysql_select_db('a8210422_lit');
}
if($db){
include_once('admin/classes/clsPOW.php');
include_once('admin/classes/clsProviders.php');
$pow = new POW();
$prov = new Providers();
$new = $pow->getNew();
$newAr = $new->val();
$get = $prov->getAll($newAr['providerId']);
$getAr = $get->val();
$img = $getAr['image'];
$name = $getAr['provider'];
$desc = $getAr['description'];
$zip = $getAr['zip'];
$web = $getAr['link'];
if($zip==0){
$zip = "Unavailable";
}
print $img;
print $name;
print $desc;
print $zip;
print $web;
}
else{
print 'fail!';
}
}
//catch exception
catch(Exception $e)
{
echo 'Message: ' .$e->getMessage();
}
?>
© Stack Overflow or respective owner