English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

My php files work fine online, but when I use WAMP5 my files gets errors. Two of them are:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in in C:\wamp\www\index.php on line 215
and Forbidden You don't have permission to access /< on this server.

This is line 215: $catname = mysql_query($query_catname, $db) or exit();

2007-11-20 03:31:45 · 4 answers · asked by Anonymous in Computers & Internet Programming & Design

4 answers

Well, it looks as though you either failed to connect to the database, or submitted a duff query. For debugging purposes, I like to display all my queries as comments in the HTML output (I use a function to print a line as a HTML comment, so I can comment them all out with one # mark). I can then test a query very easily, by copying it straight out of the page source and pasting it into the MySQL command line.

As for the "forbidden", I'd guess that was a file permissions issue -- except I don't think Windows even *has* file permissions (wouldn't know for sure though, not used Windows in years).

Create the following file:

phpinfo();
?>

and run it on both servers. Check what is different between the two, and change your own php.ini file if necessary.

By the way, if you want to run Apache and PHP on a machine at home, you really would be much better off getting a spare box and sticking something like ubuntu linux on it. Everyone I've spoken to about getting PHP, Apache and MySQL all running together on Windows says it is *a lot* harder than getting a modern Linux up and running. Real servers on the Internet are generally running some sort of unix anyway .....

2007-11-20 03:59:06 · answer #1 · answered by sparky_dy 7 · 0 0

If your using an ISP to host your php files, they probably have a default setting for your MySQL database name, users and passwords. They also will have certain default settings within PHP to allow you to control other parts of your own web site.
When your using your own PC - your running your local copy of php and will need MySQL running on your machine, making sure it is configured with the same database name, users and passwords as your using on the web.

2007-11-20 03:45:08 · answer #2 · answered by nigel r 3 · 0 0

This error is specific to the connection to the MySQL database. It would appear that online, the script has access to the MySQL database just fine, but running somewhere else, you may be passing the wrong username and password.

2007-11-20 03:37:48 · answer #3 · answered by wlasson 1 · 0 0

I don't know what is WAMP but that error is SQL connection.
You have linked to SQL and from c/.... (local harddrive) it can't connect.

2007-11-20 03:44:16 · answer #4 · answered by onlyfor7dollar 4 · 0 0

fedest.com, questions and answers