Jump to content

archiving a row


hyster

Recommended Posts

ive set up a intranet page were a user can order a set of cd's.

once i have burnt the cd's i want to archive the order data for the set of disks.

 

im not sure whats the best way to go.

 

another field in the row for "archive y/n". then if that option can i split the data into 2 html tables? current orders and archived orders.

 

the othe way i can think of is to have a archive table and move the row to there and delete the origanal table row.

 

thoughts , suggestions pls.

Link to comment
Share on other sites

ive thought on ths some more and i think my best bet is to have another field called archive and use that to sort the table.

 

only problem i have is i have no idea how to use the if statment in the context i need.

 

what i think i need to do is repeat the table but reverse the if statment

 

table1 = if $archive = "no" then echo $row

 

table2 = if $archive = "yes" then echo $row

 

<?php

include("config.php"); 
include("http://jgscov/dsgi/includes/header.html");
$tbl_name="dsgi_request"; // Table name 
mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
mysql_select_db("$db_name")or die("cannot select DB");

$tbl_name="dsgi_request"; 
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
mysql_select_db("$db_name")or die("cannot select DB");

$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);
?>

<p> </p>
<table  border="1" align="center" cellpadding="0" cellspacing="0">

<tr>
  <td width="72" align="center"><strong>Sku</strong></td>
  <td width="87" align="center"><strong>Make</strong></td>
  <td width="58" align="center"><strong>Model</strong></td>
  <td width="44" align="center"><strong>OS</strong></td>
  <td width="66" align="center"><strong>Serial</strong></td>
  <td width="59" align="center"><strong>Bcn</strong></td>
  <td width="77" align="center"><strong>Cell</strong></td>
  <td width="37" align="center"><strong>Date</strong></td>
  <td width="37" align="center"><strong>Info</strong></td>
  <td width="37" align="center"><strong>Archive</strong></td>
  <td width="45" align="center"> </td>
  <td width="37" align="center"> </td>
  </tr>
<?php
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td> <?php echo $rows['sku']; ?></td>
<td> <?php echo $rows['make']; ?></td>
<td> <?php echo $rows['model']; ?></td>
<td> <?php echo $rows['os']; ?></td>
<td> <?php echo $rows['serial']; ?></td>
<td> <?php echo $rows['bcn']; ?></td>
<td> <?php echo $rows['personel']; ?></td>
<td> <?php echo $rows['date']; ?></td>
<td> <?php echo $rows['info']; ?> </td>
<td> <?php echo $rows['archive']; ?> </td>
<td><a href="update.php?id=<?php echo $rows['id']; ?>">Update</a></td>
<td><a href="delete_ac.php?id=<?php echo $rows['id']; ?>">Delete</a></td>
</tr>
<?php
}
?>
</table>

<?php
mysql_close();
?>

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.