Jump to content


Photo

Search data from database


  • Please log in to reply
3 replies to this topic

#1 Radhe

Radhe

    Newbie

  • New Members
  • Pip
  • 5 posts

Posted 25 January 2013 - 12:32 AM

<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...

#2 Radhe

Radhe

    Newbie

  • New Members
  • Pip
  • 5 posts

Posted 25 January 2013 - 04:56 AM

<?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>";
}
?>

#3 Radhe

Radhe

    Newbie

  • New Members
  • Pip
  • 5 posts

Posted 25 January 2013 - 05:29 AM

i want to select data from the table dat in data base and than sort on basis of input and than display on same page that i've sort...

#4 PFMaBiSmAd

PFMaBiSmAd

    Advanced Member

  • Staff Alumni
  • 16,767 posts
  • LocationColorado, U.S.A.

Posted 25 January 2013 - 09:42 AM

This post seems to be the question that you asked in your first thread. Merging the two threads together...
Signature: (not a comment about anything you posted unless specifically indicated)
Debugging step #1: To get past the garbage-out equals garbage-in stage in your code, you must check that the inputs to your code are what you expect.

Programming is just problem solving, but it is done in another language. You must learn enough of the programming language you are using to be able to read and write code.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com