How to create a recordset in PHP

Hi,
How do I create a recordset in PHP and use this value to store in a array in Javascript.

Kindly help.

Thanks