I have created the following script which selcts the info form a database depending on the info the person has entered on the search page.
<?php
$dbcnx = @mysql_connect('localhost', 'root', '198024');
if (!$dbcnx) {
exit('<p>Unable to connect to the ' .
'database server at this time.</p>');
}
if (!@mysql_select_db('easeofdoing')) {
exit('<p>Unable to locate the ease of doing ' .
'database at this time.</p>');
}
?>
<?php
$keywordentered = $_GET['keyword'];
switch($_GET['type']) {
case 'ordernumber':
$result = @mysql_query("SELECT * FROM orderbook WHERE order_no LIKE '".$keywordentered."%'");
break;
case 'partnumber':
$result = @mysql_query("SELECT * FROM orderbook WHERE Part_no LIKE '".$keywordentered."%'");
break;
case 'accountname':
$result = @mysql_query("SELECT * FROM orderbook WHERE account_name LIKE '".$keywordentered."%'");
break;
}
if(mysql_num_rows($result) == 0){
echo("Sorry your query has returned no results!");
exit;
}
echo '<table border=1>';
echo '<tr><th>Order Number</th><th>Part Number</th><th>Account Name</th></tr>';
while (($row = mysql_fetch_array($result)) !== false) {
echo '<tr>';
echo '<td>' . $row['order_no'] . '</td>';
echo '<td>' . $row['Part_no'] . '</td>';
echo '<td>' . $row['account_name'] . '</td>';
echo '</tr>';
}
echo '</table>';
?>
However I have now been told that it needs to select from an xml file. How dificult is it to convert this script o an xml one??? Secondly how do i do it???
Cheers