Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your script could have been halted due to the fact that <code>in_time</code> and <code>out_time</code> do not exist in your array. Otherwise, there is no problem to your query unless you tell us what you have been assigning to the variables.</p> <p>As I have mentioned in the comments, check in the <code>error_log</code> file, which resides in the same directory as this PHP script.</p> <p>Also, is your parent loop also something along the lines of:</p> <p><code>while ($foo = @mysql_fetch_array($q1))</code></p> <p>If it is, then that might be your error. You are resetting the value of <code>$q1</code> inside the while loop, therefore possibly terminating the loop.</p> <p><strong>UPDATE:</strong> Now that you posted your code, I know your exact error:</p> <p>These are your first two lines of code, used to run the main <code>while</code> loop:</p> <pre><code>$q1 = mysql_query("select ids from $emp_data where lft = '0' order by emp_id"); while($r1 = mysql_fetch_array($q1)) </code></pre> <p>Notice that you used <code>$q1</code> to reference the query. Now down in that piece of code, inside a nested <code>while</code> loop:</p> <pre><code>$q1 = mysql_query("select in_time, out_time from $att_tbl where fk_eid = '$e_id' and a_date = '$dts'"); </code></pre> <p>You used <code>$q1</code> again. The interpreter thought that you meant to change the variable value, but instead you wanted to initialize another variable called <code>$q1</code>.</p> <p>Okay, after all that, all you need to do is write this for your code:</p> <pre><code>$q2 = mysql_query("select in_time, out_time from $att_tbl where fk_eid = '$e_id' and a_date = '$dts'"); $r2 = mysql_fetch_array($q2); $intime = $r2['in_time']; $outtime = $r2['out_time']; </code></pre> <p>And just change your references anywhere else.</p>
    singulars
    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.
    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