make the var:
Code: Select all
var $db;
Code: Select all
function class_pi(){
//constructor
global $database;
//get database
if( defined('_JEXEC') ){
//joomla 1.5
$this->db = JFactory::getDBO();
}else{
//joomla 1.0.x
$this->db = $database;
}
}
Code: Select all
$this->db->setQuery( "INSERT INTO #__pi......
but when this happens:
Code: Select all
$id = mysql_insert_id();
echo $id;exit;
This used to work, but not since I call the database in this new way.
anyone?