I have a page. ON the left column I query page fields out of the main table.
page 1
page 2
page 3
using this script query
<?
$sql = "SELECT PageID,PageName
FROM $table_main
";
$result = @($sql,$connection);
while ($row = mysql_fetch_array($result)) {
$PageID = $row['PageID'];
$PageName = $row['PageName'];
$page .= " -» <a href=\"edit-content.php?PageID=$PageID\" class=\"notice\">$PageName</a> <br>";
}
?>
<? echo "$page"; ?>
this is part of the navigation on each page.
Now when I click the link to the edit-content.php page, which will again have this quiery in the left margin. I have a script to go pull in the content, pulled from the main table.
<?
$sql2 = "SELECT PageID,
PageName,
GentextA,
GentextB,
GentextC,
GentextD,
GenRightA,
GenRightB,
GenLeftA,
GenLeftB,
PageMessage
FROM $table_main
WHERE PageID = '$PageID'
";
$result2 = @($sql2,$connection) or die("Couldn't execute query.");
while ($row2 = mysql_fetch_array($result2)) {
$PageID = $row2['PageID'];
$PageName = $row2['PageName'];
$GentextA = $row2['GentextA'];
$GentextB = $row2['GentextB'];
$GentextC = $row2['GentextC'];
$GentextD = $row2['GentextD'];
$GenRightA = $row2['GenRightA'];
$GenRightB = $row2['GenRightB'];
$GenLeftA = $row2['GenLeftA'];
$GenLeftB = $row2['GenLeftB'];
$PageMessage = $row2['PageMessage'];
}
?>
Now I do have the rest of the page with the fields to hold the recieving info, but the problem seems that no matter what page link I click and there are 7 choices, it always just retrieves the last records info. It seems that because one page is referencing the same table that something gets scewed, I am having this problem with several other pages and have left messages here to try to figure this out. Normally I would spend days trying to figure problems out and usually can come to some solution, but for this problem I can't seem to figure it out.
I do notice that if I was to move the navigation to the right side of the page then it would work properly, but there has to be a solution?
Thanks to anyone for this help.