<?
@ $db = mysql_pconnect("localhost");
if (!$db)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
}
mysql_select_db("mysql");
$manga_sql = "select * from manga
where title is not null
order by title desc";
$manga_result = mysql_query($manga_sql);
if (mysql_num_rows($manga_result)) {
$manga = mysql_fetch_array($manga_result);
echo "<a href=\"review.php?id=$manga[id]\">";
echo $manga[title];
echo "</a>";
}
?>
This is the mysql query that is run on index.php. I am displaying the data on a different page by using a code like this
<?php
/* just to be safe with register globals */
$id =& $HTTP_GET_VARS['id'];
$sql = 'SELECT *
FROM manga
WHERE id='.$id;
/* then run the query and get the results etc... */
?>
How would I combine the two codes so the original mysql query and the query that is selected is on the same php page? Like instead of sending it to review.php, it displays it on index.php?id=1.