the variable is a string accord to var_dump, how can i pass it? is correct the way i do the query? DB is Msqli
public static function two()
{
$risultato = modOne::one();
var_dump($risultato);
$ident = json_decode($risultato,true);
$db = JFactory::getDBO();
$query=$db->prepare ("SELECT avatar AS memTotal FROM #__comprofiler WHERE id = ?");
$query->bind_param("s", $ident);
$db->setQuery($query);
$resulto = $db->query();
return $resulto->fetch_object()->memTotal;
}
these return :
string(3) "751"
Fatal error: Call to a member functionbind_param()
on a non-object