Search result export to Ecxel
I want to export a search result to an Excel file. To accomplish this I need to filter the recordset on the page that generate the Excel file by the search result on my previous page. To do this I think I can use the WADbSearch1_products_Results session variable. My problem is that I'm not able to filter the recordset on my Excel page the way I want, no records are displayed on the Excel page. Here's my recordset:
$MMColParam_rsExcel = "-1";
if (isset($_SESSION['WADbSearch1_products_Results'])) {
$MMColParam_rsExcel = (get_magic_quotes_gpc()) ? $_SESSION['WADbSearch1_products_Results'] : addslashes($_SESSION['WADbSearch1_products_Results']);
}
mysql_select_db($database_localhost, $localhost);
$query_rsExcel = sprintf("SELECT * FROM products WHERE %s", GetSQLValueString($MMColParam_rsExcel, "text"));
$rsExcel = mysql_query($query_rsExcel, $localhost) or die(mysql_error());
$row_rsExcel = mysql_fetch_assoc($rsExcel);
$totalRows_rsExcel = mysql_num_rows($rsExcel);
You can test my search and my attempt on exporting the serch result to the Excel page here:
products_Search.php
I'm also attaching my products_Excel.php file.
Regards
Rune