Page 1 of 1

Connection error, works on one server not other!?

Posted: Thu Oct 02, 2003 2:41 pm
by robster
Hi all,

I have two servers, a test and real one (obviously ;) ).
The problem I'm having is located at: http://10secondclub.net/jobs.php?sort=dateasc so you can see it for yourself. The site is still under development but you get the idea :)

Basically, the password in the config.php is DEFINATELY correct. I have an admin panel for my jobs area and it uses the same file and can connect and run not a problem, so it's not the password or username etc.

Here's the code that it errors with:

Code: Select all

require("config.php");


$dbLink = @mysql_connect($dbasehost,$dbaseuser, $dbasepassword);
	mysql_select_db($dbase);
                   $sql="Select * FROM jobnum ORDER BY recordid ASC";
                   $result = mysql_query ($sql,$dbLink) or die( "oh no, there's a problems getting job list from the database.");

                     While ($row = mysql_Fetch_array($result)){
                    $user=$row['username'];
                    $pass=$row['password'];
                    }
                   mysql_close();

Can anyone see any glaring problems? I'm tearing my hair out... Surely it's so simple.

:)

Thanks !

Rob

Posted: Thu Oct 02, 2003 3:24 pm
by volka
maybe

Code: Select all

require("config.php");

$dbLink = @mysql_connect($dbasehost,$dbaseuser, $dbasepassword) or die('oh no, there is a problem with connecting the database server: '.mysql_error());
mysql_select_db($dbase) or die('oh no, there is a problem with selecting the database: '.mysql_error());;
$sql="Select * FROM jobnum ORDER BY recordid ASC";
$result = mysql_query ($sql,$dbLink) or die( "oh no, there's a problem getting job list from the database: ".mysql_error());

While ($row = mysql_Fetch_array($result)){
	$user=$row['username'];
	$pass=$row['password'];
}
mysql_close();
can shed some light on the problem.
Although it might not be a good idea exposing mysql_error() to every user it will help you now.

Posted: Thu Oct 02, 2003 3:40 pm
by robster
ok, thanks for that, the error it now gives (to the world at large, all 2000 of them a day!!!! ;) is

Parse error: parse error in /home/tsecond/public_html/jobs/job.php on line 11

Posted: Thu Oct 02, 2003 7:28 pm
by volka
and lines 10 to 12 are?