Tag Archives: recordset

PHP / MySql – Export Data to Excel

A PHP Script to export MySql data to Excel.


<!--?php
$content=””;

if($_REQUEST[‘export’])
{


$select= "select user_id,email,fname,lname,bdate,fees from user order by fname";
$result = mysql_query($select);
$num_row = mysql_num_rows($result);
Continue reading

PHP : Create array from MySql recordset

This PHP code is to create array from MySql record set.

<?php
$sel=”SELECT * FROM table_name”;
$rs=mysql_query($sel);
$i=0;
while ($row = mysql_fetch_assoc($rs))
{
$array[$i] = $row;
$i++;
}
?>