This topic is locked

Multiple queries on one page - code level

2/17/2018 11:28:33 AM
PHPRunner General questions
P
pell.net author

Hello,
I am trying to get multple quires result on one list page.

In "function On()" i need more than one query to be triggered before i can do an update or insert into another table.
Inserting isn't the issue.
I am getting a $record from $button->getCurrentRecord() but after that i need to check the state in different table which has no direct connection to the curent data set / table shown on the list page.
The clasic apporach would be to write a query and trigger it with CustomQuery($sql);
for example :
$sql = "SELECT * FROM users';

$result = CustomQuery($sql);

$result_array = [];
while($row = mysql_fetch_array($result))

{

$result_array[] = $row;

}
now, the question is how to go trough the $result variable?

Tryed clasic PHP mysql_fetch_object and var_dump-ing but no succes.
As i need to get the result from that query so i could do an insert/update on an other table.
Any suggestions or examples for this case?
Thank you