Jump to content

Database connection help


CageyJ0nnY

Recommended Posts

Hello!

 

i am creating a page that connects to an online database that I have set up. I cannot seem to connect however and as i am new to this the problem is not obvious to me...

 

Heres the code i have used:

 

<?php

 

$conn = mysql_connect(“jjennings3db.bimserver2.com”, “jjennings3db”, “bullet1238”);

 

mysql_select_db("jjennings3db", $conn);

 

$sql = "SELECT * FROM tblProperties";

 

echo "Properties Availible:<br>";

 

$result = mysql_query($sql, $conn);

 

while ($array = mysql_fetch_array($result)) {

 

echo "<p>Property Name: " . $array[PropertyName] . "<br>";

 

"</p>";

}

?>

 

Thankyou for any assistance you are able to give.

 

Jonny

Link to comment
https://forums.phpfreaks.com/topic/201472-database-connection-help/
Share on other sites

yes, the site has been specifically set up for the task. The errors i get are:

 

 

Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host '“jjennings3dbbimserver2com”' (2) in /home/jjennings3/jjennings3.bimserver2.com/home-ltd.php on line 3

 

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/jjennings3/jjennings3.bimserver2.com/home-ltd.php on line 5

Properties Availible:

 

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/jjennings3/jjennings3.bimserver2.com/home-ltd.php on line 11

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/jjennings3/jjennings3.bimserver2.com/home-ltd.php on line 13

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.