Ok. Should be simple! 🙂
I have a database called database funnily enough! Then I have a table called sections and in that table I have, id, title and section.
I then have a main file called sections.php which has a very, very simple bit of coding, then I have a template which has all the main coding in.
Basically, I'm trying to pick up what the user has in his/hers url address bar so it knows what information from the database to show. The template works fine, no errors appear, but at the same time, nothing shows! 🙁
sections.php
<?php
Include("includes/confstring.php");
Include("includes/variables.php");
Include("templates/sections.php");
// Assign variables to the url
$id = $_REQUEST['id'];
?>
sections.php (template)
<table width="620" align="right">
<tr>
<td>
<?php
$result = mysql_query("SELECT * FROM sections WHERE id='$id'") or
die (mysql_error());
while ($row = mysql_fetch_array($result))
{
echo $row["section"];
}
mysql_free_result($result);
?>
</td>
</tr>
</table>
If anybody can explain why it's not retrieving information, I'd be very grateful.
Thanks.