Jump to content

Recordset/SelectLimit Error


lwaters

Recommended Posts

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 13

Here is the coding:

<?php
//Connection statement
require_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

[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.
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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.