Click to See Complete Forum and Search --> : Help with DB connection and data array


f_dkid
03-07-2007, 06:52 PM
Hi guys, I'm having an issue that can't understand. I have a website that is running OK. After copying the website from one account to another account within the same hosting provider, the website stopped working. When it reaches the first select script stops there. No error, white pages showing only what's already loaded. The hosting customer support have been all around this for three days stating that is an error of coding, but this same script works prefectly in three other of there accounts. Any idea on why this is happening? thanx


# defining query statement necessary to get all the product elements
$sth = 'SELECT c_id, c_name FROM t_menus WHERE c_type= 0 order by c_position';
# array $data with $pid value
$data = array(0);
# gather the data on array $row
$rows = $dbh->getALL($sth);

if (count($rows) > 0){

$i = 0;

foreach ($rows as $data){

NightShift58
03-07-2007, 07:40 PM
Are you connecting to the SQL server and database?

If you were relying on a particular physical path to fetch your includes - which is where DB connections are usually defined - that may account for the problems you're experiencing.

Also, as you change accounts, your DB host may have changed, as may have your DB user name and password. That, too, could be one of your problems.

What error messages are you getting in your error logs?

If you want to see the error messages on screen, you'll have to set that with ini_set('display_errors', true), which may be set different on the new server than on the old one.

f_dkid
03-07-2007, 07:50 PM
Thanks very much. it is solved. I'm using PEAR to connect to the DB. the PEAR modules where missing from the new account. Now is running. Thanks again