I get the following error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/mikka24/public_html/PSDSHAPES/news/view.
php on line 11
On page:
http://www.mcwebdesign.jamroll.net/P.../news/view.php
I am using dreamweaver to create a table to show a record set with the following code. I don't see what is wrong with it.
- PHP: Select all
<table border="1">
<tr>
<td>title</td>
<td>content</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['title']; ?></td>
<td><?php echo $row_Recordset1['content']; ?></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<?php require_once('../Connections/PSDshapes.php'); ?>
<?php
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_PSDshapes, $PSDshapes);
$query_Recordset1 = "SELECT * FROM newscontent";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $PSDshapes) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
mysql_free_result($Recordset1);
?>
All help is appreciated.