Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2009
    Posts
    11

    Unanswered: syntax error, unexpected ';' on line 24

    this page has
    PHP Parse error: syntax error, unexpected ';' on line 24
    can anyone check the page

    this is line 24
    PHP Code:
    $getTotalHosts mysql_query("SELECT * FROM mirror WHERE uid = '$file_id'"  or die(mysql_error()); 
    and this is the whole page

    PHP Code:
    <?php

    require 'includes/db.inc.php';

    function 
    sanitize($input){
        if(
    is_array($input)){
            foreach(
    $input as $k=>$i){
                
    $output[$k]=sanitize($i);
            }
        }
        else{
            
    $output=mysql_real_escape_string($input);
        }   
       
        return 
    $output;
    }
    $_GET=sanitize($_GET);

    $file_id $_GET['uid'];




    $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());


    $getTotalHostCount mysql_num_rows($getTotalHosts);
    $getCompleteHostCount mysql_num_rows($getCompleteHosts);

    $count=0;

    if (
    $getTotalHostCount == $getCompleteHostCount)
    {
        
    $count=1;
        

    }

    echo 
    $count;


    }

    ?>

  2. #2
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    Looks like the bracketing is wrong in that line:
    Code:
    $getTotalHosts = mysql_query("SELECT * FROM mirror 
             WHERE uid = '$file_id'"  or die(mysql_error());
    It should be:
    Code:
    $getTotalHosts = mysql_query("SELECT * FROM mirror 
              WHERE uid = '$file_id'")  or die(mysql_error());
    The following line also looks wrong:
    Code:
    $getCompleteHosts = mysql_query("SELECT * FROM mirror 
              WHERE uid = '$file_id'" and status in (2,3) or die(mysql_error());
    Shouldn't it be:
    Code:
    $getCompleteHosts = mysql_query("SELECT * FROM mirror 
              WHERE uid = '$file_id' and status in (2,3)") or die(mysql_error());
    It also helps if you print out the sql in your die statement.

    Mike

  3. #3
    Join Date
    Mar 2009
    Posts
    11
    thanks it works now

Posting Permissions

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