Hello,
I'm having a small problem with some checkboxes. I am using them to allow the user to select records from a list of all records so the user can work with just those and not the others.
I'm using the code on the form the user sees with all the information,
print "<tr><td align=\"center\" {$colorset}>" . $submit_date . "</td>
<td align=\"center\"{$colorset}>" . $count . " </td>
<td align=\"center\"{$colorset}>" . $query_res['Account_Number'] . "</td>
<td align=\"center\"{$colorset}>$" . $query_res['Debit_Amount'] . "</td>
<td align=\"center\"{$colorset}>" . $query_res['Cust_Bank_Account'] . "</td>";
if ($query_res_class['class'] != "view") {
print "<td align=\"center\"{$colorset}><input type=\"checkbox\" name=\"print[]\" value=\"" . $query_res['ID'] . "\"></td></tr>";
}
As you can see from the last print statement, the button used to submit the users choices refers to a new page "Script.php" This page contains almost all my scripts and SQL statements. the statement that is run from here would be,
if (isset($_POST['subprint'])) {
include('mysqlconnect.php');
include('mysqltable_data.php');
$checkbox = $_POST['print'];
$arraytotal = count($checkbox);
for ($start = 0; $start <= $arraytotal - 1; $start++) {
$sql_query6 = "update cmu_data set printing = '', queue = 'printing' where ID = " . $checkbox[$start] . "'";
$query_run6 = mysql_query($sql_query6);
}
mysql_close();
header('location: print.php');
The final location is the Print.php page that allows the user to either view or print the data displayed.
It would seem my problem is on the script page with the check box code but as nothing happens when the script is run.
Finally when the print.php page is displayed I am getting the following error,
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in
I have identified the line with the error and it is,
while ($query_res = mysql_fetch_array($query_run))
I have tried this
while ($query_res = @mysql_fetch_array($query_run))
but since the script is not working I can't be sure the problem is corrected.
Could anyone offer a better solution or perhaps they can see where I have gone wrong.
Many many thanks.....................