hello guys
i am creating a simple script which fetches baby's names from database and shows them i made the code below so far i still need help in pagination
Please can you modify for me the code below so that i will have a nice pages links displayed for each query result
below is what am up to so far
<?php
require"config.php";// connects to mysql
require("body1.php") ; // will build the page layout
$ns=$_GET['name-starting'];// baby name first letter
$gen=$_GET['gender']; // gender
// the basic query
$result = mysql_query(" SELECT * FROM `names` WHERE ( UPPER(name) REGEXP '^$ns' AND `gender` LIKE '$gen' )");
// building table
echo ' <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr><td> </td>
<td width="20%"><b><font size="4">Name</font></b></td>
<td width="20%"><b><font size="4">Gender </font></b></td>
</tr>';
// showes result if exist
while($row = mysql_fetch_array($result))
{
//showes content from database and colors blue or pink based on gender
$name=$row['name'];
$gender=$row['gender'];
if($gender==male){ $color=E1F4FF;}
if($gender==female){ $color=FDE8F3;}
echo' <tr bgcolor='.$color.'><td>..</td>
<td width="20%" >'.$name.'</td>
<td width="20%">'.$gender.'</td>
</tr>';
}
echo "</table>";
require("footer.php");
?>