php coding for search form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
h4r00n
Forum Newbie
Posts: 2
Joined: Sun Aug 23, 2009 10:06 am

php coding for search form

Post by h4r00n »

Hi,

I have created a form in Dreamweaver and connected mySQL database to it. I am having great trouble in creating a script for it. I have found many on the internet but just cannot get my head around it. The php code I have so far is:

<?php
$username = "root";
$password = "";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
print "Connected to MySQL<br>";
$selected = mysql_select_db("jobjar",$dbh)
or die("Could not select jobjar");
?>

and I have attached a print screen of my form and what it looks like when previewed in firefox... can anyone help?
Attachments
form.JPG
form.JPG (40.88 KiB) Viewed 66 times
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: php coding for search form

Post by califdon »

It's not clear what you are asking.
h4r00n
Forum Newbie
Posts: 2
Joined: Sun Aug 23, 2009 10:06 am

Re: php coding for search form

Post by h4r00n »

Hi, I am having difficulties creating a script in which the user can search the form selecting their criteria, hit the search button and the results will be displayed. I have come across many basic search scripts on the internet but they are not what I am looking for.

Thanks
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: php coding for search form

Post by califdon »

Using the search terms php search form, Google returns many good tutorials and examples of how to generate search forms with PHP, all of them much more comprehensive than anything I could write. Here's an excellent and thorough reference: http://www.webreference.com/programming/php/search/
Post Reply