Page 1 of 1

Using ExecuteRows or ExecuteRow

Posted: Thu Apr 30, 2020 10:01 am
by PLondono
Colleagues, be careful when you use these functions, the difference is just one 'S' at the end of the sentence and makes a huge difference.

If you want to receive just one row from a SQL SELECT command use ExecuteRow (No matter if you use SELECT *) you will receive in the associative array the first selection reached.

But if you want to receive all the records selected in the associative array, you MUST use ExecuteRows (with an S at the end).

I hope this tip will help someone.

Re: Using ExecuteRows or ExecuteRow

Posted: Fri May 01, 2020 12:20 pm
by arbei
See the topic Server Events and Client Scripts -> Some Global Functions in the help file:

ExecuteRow($sql [,$dbname]) - Executes the query, and returns the first row as an array.
ExecuteRows($sql [,$dbname]) - Executes the query, and returns the rows as an array.