Posting this as a link to other script
Posted: Thu May 12, 2005 4:41 am
Hi,
I have a script which displays my mysql database records in two alternate coloured rows. I have a primary key called "asset" which is coloured red. I need this be a link which posts to another php script called viewall.php. Here is the view.php script. I have *** the part that I need to link.
Any help would be greatly appreciated folks!
regards,
Mark[/b]
Jcart | Please review
Posting Code in the Forums
I have a script which displays my mysql database records in two alternate coloured rows. I have a primary key called "asset" which is coloured red. I need this be a link which posts to another php script called viewall.php. Here is the view.php script. I have *** the part that I need to link.
Code: Select all
<?php
//The connection part missed out
// The database select part
$query = "SELECT * FROM dedicated order by type";
$result = mysql_query($query) or die ("Query failed");
//the number of rows part
$numofrows = mysql_num_rows($result);
echo "<TABLE BORDER=\"0\" table width=\"100%\">\n";
echo "<TR bgcolor=\"#cccccc\"><TD font colour=\"red\"><b>Asset</b></TD><TD><b>Title</b></TD><TD><b>Customer</b></TD><TD><b>Type</b></TD><TD><b>IP address</b></TD></TR>\n";
for($i = 0; $i < $numofrows; $i++) {
$row = mysql_fetch_array($result); //get a row from our result set
if($i % 2) { //this means if there is a remainder
echo "<TR bgcolor=\"#ffff99\">\n";
} else { //if there isn't a remainder we will do the else
echo "<TR bgcolor=\"#ffffcc\">\n";
}
[b]************** THIS PART BELOW ".$row['asset']." This needs to link through to another page however I do not know how to do this. please help ****************[/b]
echo "<TD><font color=\"red\"><b>".$row['asset']."</b></font></TD><TD><font size=\"2\">".$row['title']."</TD><TD><font size=\"2\">".$row['customer']."</TD><TD><font size=\"2\">".$row['type']."</TD><TD><font size=\"2\">".$row['IP']."</TD>\n";
echo "</TR>\n";
}
//now let's close the table and be done with it
echo "</TABLE>\n";
?>regards,
Mark[/b]
Jcart | Please review