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
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

 

Link to comment
Share on other sites

change the line to

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

Also if these are the correct credentials for the database you should change them as you've just posted them on a public forum

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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