I'm trying to create a dynamic url with php and mysql..
I have two pages. One that pulls all the information from the db. Then another page where I'd like to have the selected id be displayed with all the detailed information. The second page is titled indexid.php....
I have the url set up as...
<!--Project-->
<?
$query=mysql_query("select from portweb order by id desc limit $k, $limit");
$resultcount=mysql_result(mysql_query("select count() as count from portweb"),0,'count');
while($data=mysql_fetch_array($query)):
echo "<table class=\"subfpo\">
<tr>
<td class=\"subfpo\" align=\"center\">
<div class=\"subtpixs\" align=\"center\"><a href=\"indixid.php?k=$data[id]\"><img src=\"portfolio/$data[image]\" alt=\"print\" border=\"0\"></a></div>
</td>
<td class=\"subfpocopy\">
<div class=\"tpixs\">
<div class=\"subprojtitle\"><img src=\"grfx/t_web.gif\" alt=\"web\"></div>
<div class=\"subprojtitle\">$data[title]</div>
<div class=\"subprojdate\">$data[date]</div>
<div class=\"subprojcontent\">$data[description]</div>
<div class=\"subprojtitle\" align=\"right\"><a href=\"indexid.php?k=$data[id]\">+Full Project</a></div>
</div>
</td>
</tr>";
endwhile;
if($resultcount>0){
if(isset($k) && ($k>0)){
$prev=max($k-$limit,0);
$nav.= "<a href=\"?k=$prev\">«Previous</a> |";
}
$end=(($k+$limit)>$resultcount)?$resultcount🙁$k+$limit);
$nav.="<b>Total :".$resultcount." Showing: ".($k+1)."-".($end)."</b>";
if (isset($k) && (($k+$limit) < $resultcount)){
$next=$k+$limit;
$nav.= "|<a href=\"?k=$next\">Next»</a>";
}
echo "<tr><td class=\"subprojtitle\"><br><br>$nav</td></tr>";
}
?>
</table>
<!--//Project-->
***Then the second page (indixid.php) with... (I'd like this page to display all fields from the Id from the url. . . but it is not working, suggestions?).
<?
$query="SELECT * FROM portweb WHERE id='$id'";
$result=mysql_query($query);
$num=mysql_numrows($result);"<div class=\"flash\" align=\"center\">$data[image]</div>
<!---->
<table class=\"prevnext\">
<tr>
<td width=\"15\">back</td><td width=\"100%\" align=\"center\">1234</td><td width=\"15\">next</td>
</tr>
</table>
<table class=\"projtitle\">
<tr>
<td width=\"50%\"><img src=\"grfx/heading_featured.gif\" alt=\"featured\"></td>
<td width=\"50%\" class=\"lftborder\"><img src=\"grfx/heading_details.gif\" alt=\"details\"></td>
</tr>
</table>
<table class=\"projid\">
<tr>
<td width=\"50%\">$data[date]</td>
<td width=\"50%\" class=\"lftborder\">$data[description]</td>
</tr>
</table>
etc....etc.....
Something very similar to this tutorial:
http://www.chipmunk-scripts.com/tutorials/dynamicurl.php