mysql_fetch_assoc(): 3 is not a valid MySQL result resource

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My page displays the first result and then I get the following 
error.................

Warning: mysql_fetch_assoc(): 3 is not a valid MySQL result resource in 
c:\inetpub\wwwroot\testy\Untitled-1.php on line 29



Please help.

R.


my code.............



<?php require_once('Connections/ross.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_ross, $ross);
$query_Recordset1 = "SELECT portfolio.location_name FROM portfolio";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, 
$startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $ross) 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);
?>
<?php echo $totalRows_Recordset1 ?>
<?php do { ?>
<p><?php echo $row_Recordset1['location_name']; ?></p>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux