Jump to content

[SOLVED] Checkbox with displayed with every record in loop??


mikebyrne

Recommended Posts

Hi I can get my records to display but Id like a checkbox to appear with every record. Can I incorporate this into my loop or will i have to display the results in a set table format and place the checkbox within this??

 

My code is:

 

<?php
// let's get some data
include('adminconnect.php');
$sql = mysql_query("SELECT OrderNo, Orderdate, Custname, Amount, Shippingmet FROM admin WHERE Orderdate = DATE_FORMAT(now(),'%y/%m/%d')");
while( $row = mysql_fetch_array($sql) ) {
// loop through and display
?>

<tr align="left">
<td width="33"> </td>
<td width="82"><a href="javascript:openWindow('popup_detail.html', 'NewWindow', 615, 600)" class="black"><?php echo $row['OrderNo'];?></a></td>
<td width="61"><?php echo $row['Orderdate'];?></td>
<td width="61"><?php echo $row['Dispatchdate'];?></td>
<td width="230"><?php echo $row['Custname'];?></td>
<td width="170"><?php echo $row['Trackno'];?></td>
<td width="56" align="right"><?php echo $row['Amount'];?></td>
<td width="21"> </td>
<td width="136">test</td>
</tr>


<?
}
?>
</table>

 

 

Link to comment
Share on other sites

<?php
// let's get some data
include('adminconnect.php');
$sql = mysql_query("SELECT OrderNo, Orderdate, Custname, Amount, Shippingmet FROM admin WHERE Orderdate = DATE_FORMAT(now(),'%y/%m/%d')");
while( $row = mysql_fetch_array($sql) ) {
// loop through and display
?>

<tr align="left">
<td width="33"> </td>
<td width="82"><a href="javascript:openWindow('popup_detail.html', 'NewWindow', 615, 600)" class="black"><?php echo $row['OrderNo'];?></a></td>
<td width="61"><?php echo $row['Orderdate'];?></td>
<td width="61"><?php echo $row['Dispatchdate'];?></td>
<td width="230"><?php echo $row['Custname'];?></td>
<td width="170"><?php echo $row['Trackno'];?></td>
<input type = "checkbox name="checkbox">
<td width="56" align="right"><?php echo $row['Amount'];?></td>
<td width="21"> </td>
<td width="136">test</td>
</tr>


<?
}
?>
</table>

Link to comment
Share on other sites

what line of code you want the check box to be next?

 

<td width="61"><?php echo $row['Orderdate'];?></td> here?

<td width="61"><?php echo $row['Dispatchdate'];?></td> here?

<td width="230"><?php echo $row['Custname'];?></td> here?

<td width="170"><?php echo $row['Trackno'];?></td> here?

<input type = "checkbox name="checkbox">

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.