Ok so i have a PHP/SQL menu, and a PHP/SQL script that pulls posts from the database. When the user posts they choose which page they want to post to ie index.
Well i can get the page to display all the posts of the relevant pages, but if i try to put the menu in at the top of the page it all goes horribly wrong :(
here is my php ro pull the data
[PHP]<? $result=mysql_q uery("SELECT * FROM north WHERE page='$page'");
while ($row=mysql_fet ch_array($resul t))
{
echo "<br><div class='article1 '>{$row["title"]} <br><img src='images/{$row["image"]}'>";
echo "{$row["info"]}<br /></div><br/>";
} ?>[/PHP]
here is my php for the menu
[PHP]<? $sqlquery = "SELECT DISTINCT (page) FROM north ORDER BY page";
if ($x = mysql_query($sq lquery))
{
$number = mysql_num_rows( $x);
$i = (0);
if ($number < 1)
{
print '';
}
else
{
while($row = mysql_fetch_ass oc($x))
{
print '<a href="data.php? page='.$row ['page'].'">'.$row ['page'].'</a>';
}
}
}
mysql_close ();
?>[/PHP]
If anyone has any suggestions that would be great, oh and the menu has to be generated as its for a content management system :)
Thanks
Harry
Well i can get the page to display all the posts of the relevant pages, but if i try to put the menu in at the top of the page it all goes horribly wrong :(
here is my php ro pull the data
[PHP]<? $result=mysql_q uery("SELECT * FROM north WHERE page='$page'");
while ($row=mysql_fet ch_array($resul t))
{
echo "<br><div class='article1 '>{$row["title"]} <br><img src='images/{$row["image"]}'>";
echo "{$row["info"]}<br /></div><br/>";
} ?>[/PHP]
here is my php for the menu
[PHP]<? $sqlquery = "SELECT DISTINCT (page) FROM north ORDER BY page";
if ($x = mysql_query($sq lquery))
{
$number = mysql_num_rows( $x);
$i = (0);
if ($number < 1)
{
print '';
}
else
{
while($row = mysql_fetch_ass oc($x))
{
print '<a href="data.php? page='.$row ['page'].'">'.$row ['page'].'</a>';
}
}
}
mysql_close ();
?>[/PHP]
If anyone has any suggestions that would be great, oh and the menu has to be generated as its for a content management system :)
Thanks
Harry