Jump to content

[SOLVED] adodb help


kmark

Recommended Posts

i am using adodb and am receiving the following error message

 

Fatal error: Call to a member function on a non-object in e:\web\public_html\****\manager.php on line 59

 

the object is being used in a function - does that matter?  Code is below

 

<?
include("../adodb/adodb.inc.php");
$db =& ADONewConnection('odbc_mssql');
$dsn = "Driver={SQL Server};Server=myserver;Database=mydb;";
$db->Connect($dsn,'useruser','password');
//URL Variable Validation Not posted

//Generate Table function
function managerTable($table, $order, $type, $extra=FALSE){
$extrax = (empty($extra)) ? $type : $extra;
print '<table><tr><td colspan="3" align="right"><a href="'.strtolower($extrax).'Action.php">Add A '.$type.'</a></td></tr>';
$table .= (empty($order)) ? '' : ' ORDER BY userAdded';
$sql = "SELECT * FROM $table";
$result = $db->Execute($sql);
if($result->RecordCount() == 0){
	print '<tr><td>No Data</td></tr>';
}else{
	while(!$result->EOF){
		print '<tr><td>'.$result->fields[1].'</td><td><a href="'.strtolower($extrax).'Action.php?id='.$result->fields[0].'">Edit</a></td><td><a href="'.strtolower($extrax).'Action.php?id='.$result->fields[0].'&action=1" onclick="return confirm(\'Are you sure you want to delete this '.$type.'?\');">Delete</a></td></tr>';
	}
}
print '</table>';
}
require_once('inc/header.php');
managerTable($paramA,$paramB,$paramC,$paramD);
require_once('inc/footer.php');

 

 

Link to comment
https://forums.phpfreaks.com/topic/110621-solved-adodb-help/
Share on other sites

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.