NewBie Question: ( unexpected ';' )

Discussion in 'Programming' started by vinnyband, Nov 4, 2008.

  1. #1
    [Tue Nov 04 21:17:45 2008] [error] [client 79.173.78.16]
    PHP Parse error: syntax error, unexpected ';' in /home/user/public_html/complete.php on line 24

    
    $getTotalHosts = mysql_query("SELECT * FROM mirror WHERE uid = '$file_id'"  or die(mysql_error());
    $getCompleteHosts = mysql_query("SELECT * FROM mirror WHERE uid = '$file_id'" and status in (2,3) or die(mysql_error());
    
    
    PHP:
    Where is the error?
     
    vinnyband, Nov 4, 2008 IP
  2. shineDarkly

    shineDarkly Banned

    Messages:
    241
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you forgot to close your query with )

    mysql_query("SELECT * FROM mirror WHERE uid = '$file_id'") <-- or die(mysql_error());
     
    shineDarkly, Nov 4, 2008 IP
  3. vinnyband

    vinnyband Guest

    Messages:
    1,135
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hello thanks now it have this error here:
    syntax error, unexpected T_STRING at second line:

    
    
    $getTotalHosts = mysql_query("SELECT * FROM mirror WHERE uid = '$file_id'")  or die(mysql_error());
    $getCompleteHosts = mysql_query("SELECT * FROM mirror WHERE uid = '$file_id'") and status in (2,3) or die(mysql_error());
    
    
    PHP:
     
    vinnyband, Nov 5, 2008 IP
  4. shineDarkly

    shineDarkly Banned

    Messages:
    241
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    this should be the case in your second line, you added a closing ) and cut off the and condition

    $getCompleteHosts = mysql_query("SELECT * FROM mirror WHERE uid = '$file_id'" and status in (2,3)) or die(mysql_error());
     
    shineDarkly, Nov 5, 2008 IP