www.webdeveloper.com
Results 1 to 4 of 4

Thread: Conecting to database

Hybrid View

  1. #1
    Join Date
    Feb 2009
    Posts
    47

    Conecting to database

    Hi,

    I'm reusing a form that is supposed to connect to my database, but it keeps giving me the same error:

    Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'surftowndk' (1) in /home/www/wearecrunch.dk/gammelsjuf/ajax/register-process.php on line 60
    On line 60 this is what it says:

    Code:
    $db_conn=mysql_connect($mydb19.surftown.dk, $adamkis_adam, $mypass);
    You can see what I meen if you go to:

    http://wearecrunch.dk/gammelsjuf/

    and then click register and fill in the form with random txt and click register at the bottom.

    Then the error messages will appear.

    I hope someone in here can help me.
    Thank you

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,246
    I suspect that what you want is:
    PHP Code:
    $db_conn=mysql_connect($mydb19.'.surftown.dk'$adamkis_adam$mypass); 
    You were concatenating a PHP variable to 2 undefined contants, which PHP assumed to have a value the same as their names (an assumption I wish PHP did not make and instead threw an error/exception instead of just a warning).
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Feb 2009
    Posts
    47
    Thanks for your answer, but it still gave me the same error.
    So I tried something else now, and it gives me a different error, but it waits about 5 seconds before it gives the error, before that it is just a blank page.

    now the error is:



    Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 110 in /home/www/wearecrunch.dk/gammelsjuf/ajax/register-process.php on line 60
    and line 60 is:

    PHP Code:

    $db_conn
    =mysql_connect('mydb19.surftown.dk''adamkis_adam'$mypass); 
    I hope you can help.

    Thank you

  4. #4
    Join Date
    Jul 2012
    Location
    london
    Posts
    16

    SEO Leaders

    Dear,
    You should consult with your developer.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles