khaferi Posted August 29, 2006 Share Posted August 29, 2006 Hello,I am doing a simple directory in PHP MYSQL. I want to list all websites in a particular country. The challenge is how to return the website results as links to the corresponding sites.e.g. if there is a website www.almond.co.ke, how do I add a link so it points to the variable site? I am using a dreamweaver mx 2004 trail version to train meself. Following is the code. Anyone with an idea?I am new in php and this one beat me.Warm Regards,Kangari <?php require_once('Connections/url.php'); ?><?php$maxRows_Recordset1 = 10;$pageNum_Recordset1 = 0;if (isset($_GET['pageNum_Recordset1'])) { $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];}$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;mysql_select_db($database_url, $url);$query_Recordset1 = "SELECT * FROM urls";$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);$Recordset1 = mysql_query($query_limit_Recordset1, $url) or die(mysql_error());$row_Recordset1 = mysql_fetch_assoc($Recordset1);if (isset($_GET['totalRows_Recordset1'])) { $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];} else { $all_Recordset1 = mysql_query($query_Recordset1); $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);}$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title></head><body><table border="0" cellpadding="0" cellspacing="0"> <tr> <td width="104">id</td> <td width="125">name</td> <td width="293">url</td> <td width="293"> </td> </tr> <?php do { ?> <tr> <td><?php echo $row_Recordset1['id']; ?></td> <td><?php echo $row_Recordset1['name']; ?></td> <td><?php echo $row_Recordset1['url']; ?></td> [b]<td><?php echo $row_Recordset1['url']; ?>"> /td>[/b] </tr> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?></table><p> </p></body></html><?phpmysql_free_result($Recordset1);?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.