PDA

View Full Version : bit confused with this recordset


theman68
07-16-2011, 09:43 AM
ok pps this is the error message im getting with this page and im a little confused as it is dreamweaver that did most of the work but here it is.

my error messsage : Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/www/lirikwear.com/BundleBagNew2/php/inserts/Bindings/Suppliers.php on line 135


the code:

$maxRows_SuppliersCN = 18;
$pageNum_SuppliersCN = 0;
if (isset($_GET['pageNum_SuppliersCN'])) {
$pageNum_SuppliersCN = $_GET['pageNum_SuppliersCN'];
}
$startRow_SuppliersCN = $pageNum_SuppliersCN * $maxRows_SuppliersCN;
// && !isset($_GET['SubC']) || isset($_GET['SubC']) && $_GET['SubC'] !== "" || isset($_GET['Catagory']) || isset($_GET['Catagory' !== "")
if(isset($_GET['ContryID'])){
$colname_SuppliersCN = (get_magic_quotes_gpc()) ? $_GET['ContryID'] : addslashes($_GET['ContryID']);
$filter = "ContryRegion";
}


mysql_select_db($database_BundleBagNew, $BundleBagNew);
$query_SuppliersCN = sprintf("SELECT * FROM suppliers WHERE $filter = %s ORDER BY seq DESC", GetSQLValueString($colname_SuppliersCN, "text"));
$query_limit_SuppliersCN = sprintf("%s LIMIT %d, %d", $query_SuppliersCN, $startRow_SuppliersCN, $maxRows_SuppliersCN);
$SuppliersCN = mysql_query($query_limit_SuppliersCN, $BundleBagNew) or die(mysql_error());
$row_SuppliersCN = mysql_fetch_assoc($SuppliersCN);



if(isset($_GET['ContryID']) && isset($_GET['SubC']) && $_GET['SubC'] !== "" && isset($_GET['ContryID']) && $_GET['ContryID'] != ""){
$colname_SuppliersSC = (get_magic_quotes_gpc()) ? $_GET['CatagoryID'] : addslashes($_GET['CatagoryID']);
$colname2_SuppliersSC = (get_magic_quotes_gpc()) ? $_GET['SubC'] : addslashes($_GET['SubC']);
$colname3_SuppliersSC = (get_magic_quotes_gpc()) ? $_GET['ContryID'] : addslashes($_GET['ContryID']);




$query_SuppliersCN = sprintf("SELECT * FROM suppliers WHERE $filter = %s ORDER BY seq DESC", GetSQLValueString( $colname_SuppliersCN, "text"));

$query_limit_SuppliersCN = sprintf("%s LIMIT %d, %d", $query_SuppliersCN, $startRow_SuppliersCN, $maxRows_SuppliersCN);
$SuppliersCN = mysql_query($query_limit_SuppliersCN, $BundleBagNew) or die(mysql_error());
$row_SuppliersCN = mysql_fetch_assoc($SuppliersCN);
$query_SuppliersCN = sprintf("SELECT * FROM suppliers WHERE Catagory = %s AND BType = %s AND ContryRegion = %s ORDER BY seq DESC", GetSQLValueString($colname_SuppliersSC, "text"),GetSQLValueString($colname2_SuppliersSC, "text"),GetSQLValueString($colname3_SuppliersSC, "text"));
$query_limit_SuppliersCN = sprintf("%s LIMIT %d, %d", $query_SuppliersCN, $startRow_SuppliersCN, $maxRows_SuppliersCN);
$SuppliersCN = mysql_query($query_limit_SuppliersCN, $Lan2) or die(mysql_error());
$row_SuppliersCN = mysql_fetch_assoc($SuppliersCN);
}

if (isset($_GET['totalRows_SuppliersCN'])) {
$totalRows_SuppliersCN = $_GET['totalRows_SuppliersCN'];
} else {
$all_SuppliersCN = mysql_query($query_SuppliersCN);
(line 153) $totalRows_SuppliersCN = mysql_num_rows($all_SuppliersCN);
}
$totalPages_SuppliersCN = ceil($totalRows_SuppliersCN/$maxRows_SuppliersCN)-1;

any help really appreciated ok cheerse guys

davidj
07-26-2011, 11:21 AM
Dreamweaver recordsets confuse me too.

Ironically, the reason for this error is that Dreamweaver did all the work.