Hi,
I have a situation where I need to query the SuiteCRM database from custom/SomePageName.php.
Here is my SomePageName.php
<?php
$GLOBALS['db'];
$query = 'SELECT * FROM users';
$results = $GLOBALS['db']->query($query);
$result = $GLOBALS['db']->query($sql);
while($row = $GLOBALS['db']->fetchByAssoc($results) )
{
$id = $row['id'];
echo $id;
}
?>
Here I got three main issues:-
(i) Undefined index: db (which get resolved by using global $db instead $GLOBALS[âdbâ]),
(ii) Fatal error: Uncaught Error: Call to a member function query(),
(iii) Error: Call to a member function query() on null.
Any suggestion what has gone wrong this?