logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 07-16-2011, 09:43 AM   #1
theman68
 
Join Date: Mar 2011
Posts: 34
Default bit confused with this recordset

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_SuppliersS C, "text"),GetSQLValueString($colname3_SuppliersS C, "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
theman68 is offline   Reply With Quote
Old 07-26-2011, 11:21 AM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

Dreamweaver recordsets confuse me too.

Ironically, the reason for this error is that Dreamweaver did all the work.
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:15 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com