hyster Posted October 18, 2010 Share Posted October 18, 2010 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 https://forums.phpfreaks.com/topic/216152-archiving-a-row/ Share on other sites More sharing options...
hyster Posted October 18, 2010 Author Share Posted October 18, 2010 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 https://forums.phpfreaks.com/topic/216152-archiving-a-row/#findComment-1123371 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.