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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.