hi!!
i hv trouble in retrieve the data from mysql .... 😕 i not able to display the search result....can anyone help me check out for this??ur help is highly appreciated!! 😉
this is the search page with a search column:
<card id="card2" title="SearchPage">
Search by word/phrase:
<form method="post" action="mine.wml#card1" >
<input type="text" name="phrase" size="12"/><br/>
<img src="search2.jpg"/><br/>
<input type="submit" value="Search" />
</form><br/>
</card>
and here's the page to display the result:
<card id="card1" title="Result">
<? php
if ($_POST[phrase]=="")
{
echo "Please search again u have not key in word/phrase";
}
else
{
$db_name="translation";
$table_name="english_malay";
$connection=@mysql_connect("localhost","root","") or die(mysql_error());
$db=@mysql_select_db($db_name,$connection) or die(mysql_eror());
$sql="select * from $table_name where english='%".$_POST[phrase]."%'";
$result=@($sql,$connection) or die(mysql_error());
$num_results=mysql_num_rows($result);
echo '<p>the results are:'.$num_results.'</p>';
for($i=0;$i<$num_results;i++)
{
$row=mysql_fetch_array($result);
echo '<p><strong>'.($i+1).'.english:';
$a=stripslashes($row['english']);
echo $a;
echo '</strong><br/>Malay:';
$b=stripslashes($row['malay']);
echo $b;
}
}
?>
</card>