php mysql help making links display

can someone look at this for me… i need the links to show up on the bottom of the same page when you click on them instead of opening up an entire new page…

<?php // acquire shared info from other files include("dbconn.inc.php"); // database connection $conn = dbConnect(); ?> <?php // Retrieve image catagory information $sql = "SELECT * FROM ImgCategory ORDER BY ImgCategory.CName"; //echo $sql."
"; // for debugging $result = mysql_query($sql) or die ("query failed"); $CategoryList = "|"; //place holder for the catgories while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $CategoryList = $CategoryList." {$row['CName']} |"; } // go through the table and select each item with that particular category $theCID = $_GET['CID']; // validate CID if (is_numeric($theCID)) { // everythink is ok } else { // assign a default CID $theCID=1; } $sql = "SELECT * FROM Image WHERE Image.CID = " .$theCID; // put the result of the query array into the result variable $rs = mysql_query($sql) or die ("Queryfailed"); $numRows = mysql_num_rows($rs); // output the list items //$output = ""; $errormessage = ""; // if the results of mysql_num_rows is greater than 0 then contimuue with the loop if (mysql_num_rows($rs) > 0 ) { // print ($ImgCategory[$theCID]); // print "
    "; // fetch each record in the query results and put it in an array while ($row = mysql_fetch_array($rs, MYSQL_ASSOC)) { $output = $output ."".$row["Caption"]." |"; } // print ("
"); } else { $errormessage = $errormessage . "I'm sorry. There are no links in this category"; } // Free result set mysql_free_result($result); // close database connection mysql_close($conn); ?>


Photo Catalog

Categories: <?=$CategoryList?>


<?=$heading?>

(<?=$numRows?>) Images for Category: <?=$theCID?>

<?=$errormessage?> <?=$output?>

 

Sponsor our Newsletter | Privacy Policy | Terms of Service