Jump to content

Help with coding a seachfield


mikebyrne

Recommended Posts

Im trying to code a searchfeld for my site but Im a little confused as to how I should go about it I think the php should be as below but im a little unsure about the sql

 

<?php
include("adminconnect.php");

$tbl_name = "products";

SELECT * FROM $tbl_name WHERE ProductName= searchfield;
>

 

 

 

<select name="cat"> 
<option value="cd" selected="selected" >CD</option>
<option value="dvd" >DVD</option>
<option value="game" >GAME</option>
</select>
<form name="ex2" method="get" action="/searchresults.php">

<input type="text" name="searchfield" size="22" maxlength="40" id="srchdrop" />
<input type="submit" value="Search Now! »" id="gosrch" />

</td></tr>
</form>
[code]

[/code]

Link to comment
https://forums.phpfreaks.com/topic/98827-help-with-coding-a-seachfield/
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.