[Solved] INSERT INTO joomla table - result not as expected - Joomla! Forum - community, help and support


hi guys,

using j 1.5.14


i have created form in jumi , on next page form meant save data table created within joomla , various things.

to test out did following - print error if doesn't save , print done if save:


code: select all

$rafid = $_post['rafid'];  //brought in previous page

// following collected various doc pages:

$_data =new stdclass();
$_data->id = null;
$_data->rafid = $rafid;

$db =& jfactory::getdbo();
$db->insertobject('#__poachers', $_data, 'id') ;


if (!$query) {
echo "error";
}

else if ($query) {
echo "done";
}



so if works supposed print "done".

however info being saved table created page shows "error".

can tell me why?

many in advance.

assuming rest of code works, should help:

code: select all

$result = $db->insertobject('#__poachers', $_data, 'id') ;
if (!$result) {
echo "error";
} else {
   echo "done";
}





Comments

Popular posts from this blog

Hur installera Joomla på One.com - Joomla! Forum - community, help and support

removing index.php from URL address - Joomla! Forum - community, help and support

「イメージマップのアンカー名には、...」のエラーが出ないようにしたい