Note that there are some explanatory texts on larger screens.

plurals
  1. POmysql_fetch_array() errors after moving to xampp?
    text
    copied!<p>Until now i was making all the projects on my dedicated server which is really painful - now i decided to move local with xampp but seems like mysql_fetch_array() isn't working the same way like on my dedicated server, when im trying to see the content that works perfect on my dedi it throws these errors:</p> <pre><code>Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\includes\variables.php on line 7 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\template\win_clients.php on line 3 </code></pre> <p>here are the php codes which throws that:</p> <p>variables.php:</p> <pre><code>&lt;?php include ('config.php'); $sql_u = "SELECT * FROM users WHERE username='".$_COOKIE['u_name']."'"; $result_u = mysql_query($sql_u); $row_u = mysql_fetch_array($result_u); $sql_c = "SELECT name, user, pass, email, payment_type, last_payment FROM clients WHERE idnum='".$_COOKIE['id']."'"; $result_c = mysql_query($sql_c); ?&gt; </code></pre> <p>win_clients.php:</p> <pre><code>&lt;?php include('../includes/variables.php'); while ($row_c = mysql_fetch_array($result_c)) { .......... </code></pre> <p>config.php:</p> <pre><code>//Connect to database from here $link = mysql_connect('localhost', 'root', 'xxxxx'); if (!$link) { die('Could not connect: ' . mysql_error()); } //select the database | Change the name of database from here mysql_select_db('xxxxxx'); </code></pre> <p>as you can see every time I'm trying to run mysql_fetch_array() its not working. And another thing: the config.php file is working cause i can login into the system and it sets the cookies as it needs to.</p> <p>Any help would be appreciated. </p> <p><strong>EDIT: I fixed it by replacing the normal include with "include __ DIR __ . '/config.php';".</strong></p>
 

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