Jump to content

Search data from database


Radhe

Recommended Posts

<table>

<tr>

<td>

<table width="223" border="0" align="left" cellpadding="3" cellspacing="3">

<tr>

<td width="100" align="center"><input name="Search" type="text" width="100%" placeholder="Sort By"/></td>

<td width="80" align="center"><input name="Search" type="button" value="Search" /></td>

</tr>

</table>

</td>

</tr>

 

<tr>

<td><table align="left" cellpadding="3" cellspacing="3" border="1">

<tr>

<td align="left"><label>Sort By Skills</label></td>

<td align="center"><input name="Skills" type="checkbox" value="skills" /></td>

</tr>

 

<tr>

<td align="left"><label>Sort By Experience</label></td>

<td align="center"><input name="Experince" type="checkbox" value="experince" /></td>

</tr>

 

<tr>

<td align="left"><label>Sort by Duration of Hire</label></td>

<td align="center"><input name="Duration of Hire" type="checkbox" value="dur_hire" /></td>

</tr>

 

<tr>

<td align="left"><label>Sort by Location of Hire</label></td>

<td align="center"><input name="Location of Hire" type="checkbox" value="loc_hire" /></td>

</tr>

 

</table></td>

</tr>

</table>

 

i've done code like this now on the basis of the selected checkbox i want to sort the data... and from sorting of data i want o search particular data by given keywords in search text box...

Link to comment
https://forums.phpfreaks.com/topic/273618-search-data-from-database/
Share on other sites

<?php

 

mysql_select_db("db_name") or die(mysql_error());

 

$data = mysql_query("SELECT * FROM table_name")

or die(mysql_error());

 

while($info = mysql_fetch_array( $data ))

{

echo "<tr>";

echo "<td>".$info['id'] . "</td>";

echo "<td>".$info['fname'] . "</td> ";

echo "<td>".$info['lname'] . "</td>";

echo "</tr>";

}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.