Jump to content

Problem with search script PHP


kpetsche20

Recommended Posts

I'm trying to make a search function for my mysql DB, but it donesn't do anything when I click on submit to try and  search

 

 

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

  <tr>

    <td width="522"><p>Search </p>

<?

if(isset($_POST['Submit']))

{

$searchsql = "SELECT * FROM tblpeople";

$searchquery = mysql_query($searchsql);

while($search = mysql_fetch_array($searchquery))

{

if($_POST['search'] == $search['indlastname'])

{

echo "Works";

} }

else { echo "wroing"; }

}

 

 

?>

 

<form action="index.php?p=search" method="POST">

<select name="table">

  <option value="tblpeople">Search Clients</option>

  <option value="sadf">ddd</option>

</select>

<input name="search" type="text" />

<input type="submit" name="Submit" value="Submit" />

</form>  </td>

  </tr>

</table>   

Link to comment
https://forums.phpfreaks.com/topic/113005-problem-with-search-script-php/
Share on other sites

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.