Reply to Using check box in table to select records

Your name:

Reply:


Posted by Ian Davies on 11/05/77 11:28

Hello all
I have the following PHP script to place records from my MySql db into a
table. However I now wish users to beable to select the multiple records
from the table and on clicking a button the selected records are stored to
another table in my db. I have started by including a check box in the first
column but dont know the code necessary to check all the row in the table
and copy the records of those boxes thats ticked
Can anyone help?
Thanks
Ian
*****************************************
<table width="1022" border="2" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="48"><div align="left"><span
class="style2">Select</span></div></td>
<td width="91"><span class="style2">Question No </span></td>
<td width="527"><span class="style2">Question</span></td>
<td width="42">path</td>
<td width="42"><span class="style2">Type</span></td>
<td width="256"><span class="style2">Image</span></td>
</tr>
<tr>
<?php
while($row =& mysql_fetch_assoc($result)) {
extract($row);

if ($i%2) {
$class = 'row1';
} else {
$class = 'row2';
}

$i += 1;

if ($ImagePath) {
//$Image = WEB_ROOT . 'images/PupilTester/' . $ImagePath;
$Image = 'images/PupilTester/' . $ImagePath;
} else {
$Image ='images/PupilTester/nopicture.bmp';
}

?>


?>

<tr class="<?php echo $class; ?>">
<td>
<div align="center">
<input type="checkbox" name="checkbox" value="checkbox">
</div></td>
<td><?php echo $QuestionNo; ?>&nbsp;</td>
<td><?php echo $Question; ?></td>
<td><?php echo $ImagePath; ?></td>
<td><?php echo $TypeID; ?> <div align="center"></div></td>
<td><img src=<?php echo $Image; ?>></td>
</tr>
<?php
*************************************

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация