MySQL Forums
Forum List  »  PHP

DB Connection error! Please help me
Posted by: Brian Ross
Date: May 07, 2005 12:07PM

I have a hw assignment in which i need to u/l an html and php file to a server that allow a person to create,delete,insert and view a product table. Im using easyphp 1.8 to act as a virtual server on my pc and i've gotten it so that everything works great on my computer. But when i try to upload the files and then click any of the SQL buttons i get this error:

Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'localhost/students' (1) in /home/genit17ure/public_html/query.php on line 28

Now originally the prof wanted us to use PEAR but she said that we didn't have to. In our assignment she told us to connect to a DB called students and my specified table is genit17ure. the PEAR DB connection string she gave me is
$db = DB::connect('mysql://genit17ure:243157@localhost/students');

so i tried to translate that to sql using the following code:

$db="students";

$link = mysql_connect("localhost/students", "genit17ure", "243157");

if (! $link)

die("Couldn't connect to MySQL");

mysql_select_db($db , $link)

or die("Select DB Error: ".mysql_error());

Can you figure out what im doing wrong cuz this is killing me.

Options: ReplyQuote


Subject
Written By
Posted
DB Connection error! Please help me
May 07, 2005 12:07PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.