<?php
if (!$conn = new COM("ADODB.Connection"))
exit("Unable to create an ADODB connection<br>");
$strConn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("./ECAT.mdb").";";
$conn->open($strConn);
$name1=$_GET['name'];
define("count", 0);

//starting the Xml print format//
print"<dataSet>";

$strSQL = "SELECT * from product WHERE description like '%$name1%' ORDER BY description"."; ";
$rs = $conn->execute($strSQL);
$category =$rs->Fields(0);
$page =$rs->Fields(1);
$directory =$rs->Fields(2);
define("count", 0);
$num=count($rs);
$count=$num-1;
while (!$rs->EOF)
{
print"<data>";

print "<name>"."$page->value "."( Part No."."$category->value"." )"."</name>";
print "<dataRow>"."$category->value "."</dataRow>";
$count=$count+1;
$rs->MoveNext();

print "</data>";
}
print "</dataSet>";

//Ending the Xml print format//

print " &reccount=".$count." Records Obtained";
print " &loading=NO ";

// Tidy up
//$rs->Close();
//$conn->Close();
//$rs = null;
//$conn = null;
?>





this code is very slow....cos it creates a connection everytime and closes it ....i need to create the connection just at the starting of the application load ad close it when the application closes.....how do i split this file into the open , the function and the close part....plshelp me wiht this sme file ...n how do declare a php function and call two functions in the same php file from flash ...therer two buttons but each calls a separate php file ...i wantboth to call two different queries or two different functions within the same php file ...pls help ...thanks in advance.....