Closed Thread
Results 1 to 2 of 2

Thread: cannot connect mysql

  1. #1
    bohlinghaus is offline x10Hosting Member bohlinghaus is an unknown quantity at this point
    Join Date
    Jan 2012
    Posts
    1

    cannot connect mysql

    i know this has been asked before but unfortunately i do not see a solution...

    mysql_connect('localhost','xxx_xxx','xxxx')or die("Cannot connect to server. Sorry.");
    mysql_select_db('xxxx_xxxx_xxxx')or die("Sorry, database is not reachable");

    it dies on the second line.

    a dbase is created, so no problem there.

    i know you have to create dbase on cpanel, but can tables be created with php? maybe that is where the problem lies.

    ---------- Post added at 05:14 PM ---------- Previous post was at 03:52 PM ----------

    disregard, i think i fell into a solution blindly. i would mark closed, but do not know how. thanks.

  2. #2
    narender is offline x10Hosting Member narender is an unknown quantity at this point
    Join Date
    Apr 2010
    Posts
    2

    Smile Re: cannot connect mysql

    $link = mysql_connect('localhost','xxx_xxx','xxxx')or die("Cannot connect to server. Sorry.");
    mysql_select_db('xxxx_xxxx_xxxx', $link)or die("Sorry, database is not reachable");

    use the above code for connect hopefully it will be connected with the $link.
    i think you have missed the link.

    Regards,
    Narender
    http://narenderdesigns.x10.mx

Closed Thread

Similar Threads

  1. Replies: 2
    Last Post: 08-03-2011, 06:46 PM
  2. Replies: 1
    Last Post: 10-15-2010, 01:46 PM
  3. Replies: 2
    Last Post: 10-14-2010, 01:50 PM
  4. Replies: 2
    Last Post: 10-14-2010, 10:49 AM
  5. Replies: 2
    Last Post: 12-17-2007, 03:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers