Danny
January 2nd, 2008, 18:18
Hi Guys!
Im having trouble getting a database and site connected up since i transferred to a new server. The dbconnect.php file is as follows:
<?php
mysql_connect('64.49.219.212', 'xxxx_company', 'xxxx');
mysql_select_db('xxxx_codatabase');
if (!$link) {
die('We are currently updating our website, please come back another time. Sorry for any inconvenience. ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
And the details.php file that calls the dbconnect.php file is as follows:
<?php
include 'dbconnect.php';
$id = is_numeric($_GET['id'])?$_GET['id']:1;
$get = mysql_query("SELECT * FROM xxxxx_codatabase where ID = $id") or die("Mmm pie:" . mysql_error());
while ($row = mysql_fetch_row($get)) {
echo "<img style=\"float: left; padding: 2px;\" src=".$row[1]."><br><br><br><br>";
echo "<br><h2>".$row[2]."</h2><br>";
echo "<strong>Address: </strong><br>".$row[3]."";
echo "<br>".$row[4]."";
echo "<br>".$row[5]."";
echo "<br><br><strong>Postcode:<br></strong> ".$row[6]."";
echo "<br><br><strong>Phone Number:<br></strong>".$row[7]."";
echo "<br><br><strong>Email Address:</strong><br><a href='mailto:".$row[8]."'>".$row[8]."</a>";
echo "<br><br><a href=".$row[9].">".$row[9]."</a>";
echo "<br><br><strong>Contact</strong><br>".$row[11]."";
}
?>
All I keep getting is the error message stated in the dbconnect.php file - any ideas?
Danny
Im having trouble getting a database and site connected up since i transferred to a new server. The dbconnect.php file is as follows:
<?php
mysql_connect('64.49.219.212', 'xxxx_company', 'xxxx');
mysql_select_db('xxxx_codatabase');
if (!$link) {
die('We are currently updating our website, please come back another time. Sorry for any inconvenience. ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
And the details.php file that calls the dbconnect.php file is as follows:
<?php
include 'dbconnect.php';
$id = is_numeric($_GET['id'])?$_GET['id']:1;
$get = mysql_query("SELECT * FROM xxxxx_codatabase where ID = $id") or die("Mmm pie:" . mysql_error());
while ($row = mysql_fetch_row($get)) {
echo "<img style=\"float: left; padding: 2px;\" src=".$row[1]."><br><br><br><br>";
echo "<br><h2>".$row[2]."</h2><br>";
echo "<strong>Address: </strong><br>".$row[3]."";
echo "<br>".$row[4]."";
echo "<br>".$row[5]."";
echo "<br><br><strong>Postcode:<br></strong> ".$row[6]."";
echo "<br><br><strong>Phone Number:<br></strong>".$row[7]."";
echo "<br><br><strong>Email Address:</strong><br><a href='mailto:".$row[8]."'>".$row[8]."</a>";
echo "<br><br><a href=".$row[9].">".$row[9]."</a>";
echo "<br><br><strong>Contact</strong><br>".$row[11]."";
}
?>
All I keep getting is the error message stated in the dbconnect.php file - any ideas?
Danny