Using ExecuteRows or ExecuteRow

Tips submitted by PHPMaker users
Post Reply
PLondono
User
Posts: 7

Using ExecuteRows or ExecuteRow

Post 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.

arbei
User
Posts: 9389

Post 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.

Post Reply