Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Checkboxes, will they kill me or I them?
Old 07-04-2005, 03:40 PM Checkboxes, will they kill me or I them?
merlin's Avatar
Skilled Talker

Posts: 52
Trades: 0
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,
PHP Code:
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,
PHP Code:
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,
PHP Code:
Warningmysql_fetch_array(): supplied argument is not a valid MySQL result resource in 
I have identified the line with the error and it is,
PHP Code:
while ($query_res mysql_fetch_array($query_run)) 
I have tried this
PHP Code:
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.....................
__________________
No more yankey my wankey, the Donger need food!
merlin is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Checkboxes, will they kill me or I them?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.08298 seconds with 12 queries