Problem med bindings/recordset
Jeg sidder og er ved at lave et cms i dreamweaver, men php og mysql.Men er løbet ind i det problem at mine bindings ikke bliver vist på forsiden, så håber en eller anden gider kigge min kode igennem og se om de kan finde grunden til at de ikke bliver vist som de skal.
<?php require_once('Connections/sunbao.php'); ?>
<?php
$maxRows_rsSideindhold = 1;
$pageNum_rsSideindhold = 0;
if (isset($_GET['pageNum_rsSideindhold'])) {
$pageNum_rsSideindhold = $_GET['pageNum_rsSideindhold'];
}
$startRow_rsSideindhold = $pageNum_rsSideindhold * $maxRows_rsSideindhold;
$colname_rsSideindhold = "-1";
if (isset($_GET['id'])) {
$colname_rsSideindhold = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
mysql_select_db($database_sunbao, $sunbao);
$query_rsSideindhold = sprintf("SELECT * FROM sideindhold WHERE id = %s ORDER BY id DESC", $colname_rsSideindhold);
$query_limit_rsSideindhold = sprintf("%s LIMIT %d, %d", $query_rsSideindhold, $startRow_rsSideindhold, $maxRows_rsSideindhold);
$rsSideindhold = mysql_query($query_limit_rsSideindhold, $sunbao) or die(mysql_error());
$row_rsSideindhold = mysql_fetch_assoc($rsSideindhold);
if (isset($_GET['totalRows_rsSideindhold'])) {
$totalRows_rsSideindhold = $_GET['totalRows_rsSideindhold'];
} else {
$all_rsSideindhold = mysql_query($query_rsSideindhold);
$totalRows_rsSideindhold = mysql_num_rows($all_rsSideindhold);
}
$totalPages_rsSideindhold = ceil($totalRows_rsSideindhold/$maxRows_rsSideindhold)-1;
$colname_RsSubmenu = "-1";
if (isset($_GET['mainid'])) {
$colname_RsSubmenu = (get_magic_quotes_gpc()) ? $_GET['mainid'] : addslashes($_GET['mainid']);
}
mysql_select_db($database_sunbao, $sunbao);
$query_RsSubmenu = sprintf("SELECT * FROM sideindhold WHERE mainid = %s", $colname_RsSubmenu);
$RsSubmenu = mysql_query($query_RsSubmenu, $sunbao) or die(mysql_error());
$row_RsSubmenu = mysql_fetch_assoc($RsSubmenu);
$totalRows_RsSubmenu = mysql_num_rows($RsSubmenu);
?><html>
<head>
<title>:::SUNBAO.DK:::</title>
<link href="css/styles.css" rel="stylesheet" type="text/css">
</head>
<body >
<div class="container" id="container">
<table width="100%" border="0" cellpadding="5">
<tr>
<td height="37" colspan="2" class="banner"></td>
</tr>
<tr>
<td height="32" colspan="2" valign="baseline" class="menubar"><a href="index.php?id=1&mainid=1">Topmenu1</a> | <a href="index.php?id=2&mainid=2">Topmenu2</a> | <a href="index.php?id=3&mainid=3">Topmenu3</a> | <a href="index.php?id=4&mainid=4">Topmenu4</a> | <a href="index.php?id=5&mainid=5">Topmenu5 </a></td>
</tr>
<tr>
<td width="135" height="91" class="overskrifter"><?php do { ?>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td valign="baseline" class="overskrifter"><a href="ndex.php?id=<?php echo $row_rsSubmenu [ 'id' ] ; ?>&mainid=<?php echo $row_rsSubmenu [ 'mainid' ] ; ?>"><?php echo $row_RsSubmenu['navn']; ?></a></td>
</tr>
</table>
<?php } while ($row_RsSubmenu = mysql_fetch_assoc($RsSubmenu)); ?><p> </p>
</td>
<td width="593"><table width="100%" border="0" cellpadding="5" cellspacing="0" class="overskrifter">
<tr>
<td><?php echo $row_rsSideindhold['overskrift']; ?></td>
</tr>
<tr>
<td><?php echo $row_rsSideindhold['tekst1']; ?></td>
</tr>
<tr>
<td><?php echo $row_rsSideindhold['billede']; ?></td>
</tr>
<tr>
<td><?php echo $row_rsSideindhold['tekst2']; ?></td>
</tr>
</table>
<p> </p>
<p></p></td>
</tr>
</table>
</div>
</body>
</html>
<?php
mysql_free_result($rsSideindhold);
mysql_free_result($RsSubmenu);
?>