Skip to main content
Participant
January 27, 2010
Question

php mysql (error)

  • January 27, 2010
  • 1 reply
  • 312 views

i have developed a website using php. On my local server (wamp) the website is working very fine. but when i uploaded the website to the hosting server it gives the following error. I tried a lot to resolve this issu but as i am beginer to php mysql and i am uploading the web sit for the first time.so i am facing this problem.the error is as follows.

Warning:  mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/care2you/public_html/news.php on line 34

Warning:  mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/care2you/public_html/news.php on line 36

the php code of line 34 to 36 is as follows

(34) mysql_select_db($database_caretoyou, $car2you_caretoyou);
(35) $query_getNews = "SELECT * FROM news";
(36) $getNews = mysql_query($query_getNews, $car2you_caretoyou) or die(mysql_error());

plese help me

regards

gul

This topic has been closed for replies.

1 reply

David_Powers
Inspiring
January 27, 2010

It means there's something wrong with the database connection. Is MySQL running? Can you connect to MySQL in other ways, for example, through phpMyAdmin? If the answer to both is yes, it sounds as though a firewall might be preventing connection between Dreamweaver and MySQL. Another possibility is that you haven't set up your testing server definition correctly.