lwaters Posted November 14, 2006 Share Posted November 14, 2006 I am trying to create a product page that uses several different recordsets that pulls data from a MySQL database with several tables within the database. I am using Dreamweaver to do this. I keep getting this message:Fatal error: Call to undefined function: selectlimit() in /home/imr2006/public_html/2007_product_line_test.php on line 13Here is the coding:<?php//Connection statementrequire_once('Connections/Products.php');// begin Recordset$query_Products = "SELECT * FROM Products";$Products = $Products->SelectLimit($query_Products) or die($Products->ErrorMsg());$totalRows_Products = $Products->RecordCount();// end Recordset// begin Recordset$query_Recordset1 = "SELECT * FROM States";$Recordset1 = $Products->SelectLimit($query_Recordset1) or die($Products->ErrorMsg());$totalRows_Recordset1 = $Recordset1->RecordCount();// end Recordset// begin Recordset$query_Scales = "SELECT * FROM Scales WHERE Category = 'Automotive'";$Scales = $Products->SelectLimit($query_Scales) or die($Products->ErrorMsg());$totalRows_Scales = $Scales->RecordCount();// end Recordset// begin Recordset$query_Countries = "SELECT * FROM Countries";$Countries = $Products->SelectLimit($query_Countries) or die($Products->ErrorMsg());$totalRows_Countries = $Countries->RecordCount();// end Recordset//PHP ADODB document - made with PHAkt 3.7.1?>Does anyone know how to fix this. I am on a tight deadline so, I would appreciate any help that you can give. Thanks. Link to comment https://forums.phpfreaks.com/topic/27235-recordsetselectlimit-error/ Share on other sites More sharing options...
Orio Posted November 14, 2006 Share Posted November 14, 2006 Where do you define a function called setlimit() ? There's no such function in PHP and I cant see you declaring it....Orio. Link to comment https://forums.phpfreaks.com/topic/27235-recordsetselectlimit-error/#findComment-124528 Share on other sites More sharing options...
lwaters Posted November 14, 2006 Author Share Posted November 14, 2006 I have no idea. I usually use ASP so, I don't know PHP very well. Do you have any advise on how to fix this? Link to comment https://forums.phpfreaks.com/topic/27235-recordsetselectlimit-error/#findComment-124541 Share on other sites More sharing options...
trq Posted November 14, 2006 Share Posted November 14, 2006 [quote]I usually use ASP so, I don't know PHP very well. Do you have any advise on how to fix this?[/quote]The concepts are the same in any language, you cannot use a function without it being defined firstly. Can we see where you define this $Products object? In Connections/Products.php by the looks of it. Link to comment https://forums.phpfreaks.com/topic/27235-recordsetselectlimit-error/#findComment-124544 Share on other sites More sharing options...
lwaters Posted November 14, 2006 Author Share Posted November 14, 2006 Here is the Connections file:[code]<?php # PHP ADODB document - made with PHAkt # FileName="Connection_php_adodb.htm" # Type="ADODB" # HTTP="true" # DBTYPE="mysql" $MM_Products_HOSTNAME = 'localhost'; $MM_Products_DATABASE = 'mysql:imr2006_Products'; $MM_Products_DBTYPE = preg_replace('/:.*$/', '', $MM_Products_DATABASE); $MM_Products_DATABASE = preg_replace('/^[^:]*?:/', '', $MM_Products_DATABASE); $MM_Products_USERNAME = 'imr2006_admin'; $MM_Products_PASSWORD = ''; $MM_Products_LOCALE = 'En'; $MM_Products_MSGLOCALE = 'En'; $MM_Products_CTYPE = 'P'; $KT_locale = $MM_Products_MSGLOCALE; $KT_dlocale = $MM_Products_LOCALE; $KT_serverFormat = '%Y-%m-%d %H:%M:%S'; $QUB_Caching = 'false'; $KT_localFormat = $KT_serverFormat; if (!defined('CONN_DIR')) define('CONN_DIR',dirname(__FILE__)); require_once(CONN_DIR.'/../adodb/adodb.inc.php'); $Products=&KTNewConnection($MM_Products_DBTYPE); if($MM_Products_DBTYPE == 'access' || $MM_Products_DBTYPE == 'odbc'){ if($MM_Products_CTYPE == 'P'){ $Products->PConnect($MM_Products_DATABASE, $MM_Products_USERNAME,$MM_Products_PASSWORD); } else $Products->Connect($MM_Products_DATABASE, $MM_Products_USERNAME,$MM_Products_PASSWORD); } else if (($MM_Products_DBTYPE == 'ibase') or ($MM_Products_DBTYPE == 'firebird')) { if($MM_Products_CTYPE == 'P'){ $Products->PConnect($MM_Products_HOSTNAME.':'.$MM_Products_DATABASE,$MM_Products_USERNAME,$MM_Products_PASSWORD); } else $Products->Connect($MM_Products_HOSTNAME.':'.$MM_Products_DATABASE,$MM_Products_USERNAME,$MM_Products_PASSWORD); }else { if($MM_Products_CTYPE == 'P'){ $Products->PConnect($MM_Products_HOSTNAME,$MM_Products_USERNAME,$MM_Products_PASSWORD, $MM_Products_DATABASE); } else $Products->Connect($MM_Products_HOSTNAME,$MM_Products_USERNAME,$MM_Products_PASSWORD, $MM_Products_DATABASE); } if (!function_exists('updateMagicQuotes')) { function updateMagicQuotes($HTTP_VARS){ if (is_array($HTTP_VARS)) { foreach ($HTTP_VARS as $name=>$value) { if (!is_array($value)) { $HTTP_VARS[$name] = addslashes($value); } else { foreach ($value as $name1=>$value1) { if (!is_array($value1)) { $HTTP_VARS[$name1][$value1] = addslashes($value1); } } } } } return $HTTP_VARS; } if (!get_magic_quotes_gpc()) { $_GET = updateMagicQuotes($_GET); $_POST = updateMagicQuotes($_POST); $_COOKIE = updateMagicQuotes($_COOKIE); } } if (!isset($_SERVER['REQUEST_URI']) && isset($_ENV['REQUEST_URI'])) { $_SERVER['REQUEST_URI'] = $_ENV['REQUEST_URI']; } if (!isset($_SERVER['REQUEST_URI'])) { $_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF'].(isset($_SERVER['QUERY_STRING'])?"?".$_SERVER['QUERY_STRING']:""); }?>[/code] Link to comment https://forums.phpfreaks.com/topic/27235-recordsetselectlimit-error/#findComment-124551 Share on other sites More sharing options...
trq Posted November 14, 2006 Share Posted November 14, 2006 That doesn't help at all. We need to Products.php file I believe. This is the trouble with having a program like Dreamweaver write your code, youi have no idea where anything is or what is really going on. Link to comment https://forums.phpfreaks.com/topic/27235-recordsetselectlimit-error/#findComment-124559 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.