Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP giving boolean error with mysql_fetch_row
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/2973202/php-error-mysql-fetch-array-expects-parameter-1-to-be-resource-boolean-given">PHP Error: mysql_fetch_array() expects parameter 1 to be resource, boolean given</a> </p> </blockquote> <p>So heres what my error is:</p> <pre><code>Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /home/content/12/8781812/html/internal/domain/property/process.php on line 17 </code></pre> <p>The code is: </p> <pre><code>function checkTOS($username){ include("includes/opendb.php"); $user2check = mysql_real_escape_string($_POST['username']); $query = "SELECT * FROM user WHERE username=".$user2check; $result = mysql_query($query); while($row = mysql_fetch_row($result)){ $TOS = $row[11]; } if($TOS == 1){ return true; }else{ return false; } } </code></pre> <p>Line 17 is:</p> <pre><code>while($row = mysql_fetch_row($result)){ </code></pre> <p>This is basically checking to see if the user accepted the terms of service in the main user db.</p> <p><strong>EDIT:</strong></p> <p>So I fixed it but now I get nothing when I try to print my row... Heres the new code.</p> <pre><code>function checkTOS($preusergrab){ include("includes/opendb.php"); $query = "SELECT * FROM users WHERE username='".$preusergrab."'"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_row($result)){ $TOS = $row[11]; } // echo $query; print_r($row); die(); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload