Forum Moderators: coopster

Message Too Old, No Replies

Help with connecting to database

         

gswahla

8:40 pm on Jul 14, 2003 (gmt 0)

10+ Year Member



My friend created a php/mysql website for me. It is an ecommerce website. I managed to get it up and running on my PC using IIS, so I can edit it and see what it looks like without having to put it on the net.

It includes an admin section where i Have to log in and then I can add edit or delet products from the site. I was able to do this without any prob before, but it has started giving me an error:

The host, username and password combination were incorrect

Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in C:\Inetpub\wwwroot\fantasy\utils\Database.php on line 120

Referring to the following section:


} // function install()

function error_msg($type,$addition = "") {
$errors = array("conn" => "The host, username and password combination were incorrect",
"database" => "It was not possible to connect to the database: <b>$addition</b>",
"query" => "The following query could not be performed: <b>$addition</b>",
"install_open" => "You must open a connection to the database before you can install",
"install_file" => "The installation file does not exist: <b>$addition</b>");

if ($this->debug) {
echo "<p>".$errors[$type]."</p>";
(line 120) echo "<p>".mysql_error($this->conn)."</p>";
}
} // function error_msg()

I thoguht it was because I didnt install the DB properly, and when I try to do that, i get a similar error:

The host, username and password combination were incorrect

Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in C:\Inetpub\wwwroot\fantasy\utils\Database.php on line 120

You must open a connection to the database before you can install

Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in C:\Inetpub\wwwroot\fantasy\utils\Database.php on line 120

If there are no error messages printed, the database has installed correctly


Please help if anyone can, or if more info is needed, lemme know...

Thanks

moltar

9:24 pm on Jul 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you have MySQL installed? If not, you first need to install database server (www.MySQL.com) then, recreate the database and all the tables that are used in the script.

You maybe should check with your friend on which tables to recreate.

charlier

10:02 pm on Jul 14, 2003 (gmt 0)

10+ Year Member



It might also be helpful to get a web browser based client front end for mysql. I use and recommend phpmyadmin ( [phpmyadmin.net...] . It is fairly easy to configure and you can do most any database function, like making tables, checking tables, selects etc.

Shadi

10:48 pm on Jul 14, 2003 (gmt 0)

10+ Year Member



if you did not have MySQL installed, then once installed, then install phpmyadmin, and then you will need a SQL dump of the database that your friend used for the site. It is basicly a collection of SQL statments that set up all your tables (and possably data) for use with your system.

gswahla

7:46 am on Jul 15, 2003 (gmt 0)

10+ Year Member



i have got mysql installed and running (mysql-nt.exe is running in the background).

I am pretty sure I created the table, from command prompt in mysql prompt, I created the single table i need. I will get phpmyadmin and see what happens.