help with mysql errors

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • aquilo at hotmail.com

    #1

    help with mysql errors

    I have these 3 errors and below are lines 17-19. Any suggestions what I
    am forgetting?

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

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

    Warning: mysql_close(): supplied argument is not a valid MySQL-Link
    resource in /home/---/public_html/----/register2.php on line 19
    16 $linkID = @mysql_connect( "localhost" , $username, $password);
    17 mysql_select_db ($dbname, $linkID);
    18 $result = mysql_query("IN SERT INTO alumni
    (rank,firstname ,lastname,email ,passw,comments ) VALUES
    ('$rank','$firs tname','$lastna me','$email','$ passw','$textar ea')", $linkID);
    19 mysql_close($li nkID);

  • Aggro

    #2
    Re: help with mysql errors

    aquilo at hotmail.com wrote:[color=blue]
    > I have these 3 errors and below are lines 17-19. Any suggestions what I
    > am forgetting?[/color]
    [color=blue]
    > 16 $linkID = @mysql_connect( "localhost" , $username, $password);
    > 17 mysql_select_db ($dbname, $linkID);[/color]

    You don't check for errors. MY guess would be that you fail to connect
    to server and the $linkID has null value.

    Comment

    • Aggro

      #3
      Re: help with mysql errors

      aquilo at hotmail.com wrote:[color=blue]
      > I have these 3 errors and below are lines 17-19. Any suggestions what I
      > am forgetting?[/color]
      [color=blue]
      > 16 $linkID = @mysql_connect( "localhost" , $username, $password);
      > 17 mysql_select_db ($dbname, $linkID);[/color]

      You don't check for errors. MY guess would be that you fail to connect
      to server and the $linkID has null value.

      Comment

      • Aggro

        #4
        Re: help with mysql errors

        aquilo at hotmail.com wrote:[color=blue]
        > I have these 3 errors and below are lines 17-19. Any suggestions what I
        > am forgetting?[/color]
        [color=blue]
        > 16 $linkID = @mysql_connect( "localhost" , $username, $password);
        > 17 mysql_select_db ($dbname, $linkID);[/color]

        You don't check for errors. MY guess would be that you fail to connect
        to server and the $linkID has null value.

        Comment

        Working...