August 23, 200917 yr 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?
August 23, 200917 yr Do you know how to query a database? If so you will be wanting to look into FULL TEXT indexing within your database and using an appropriate query based on the users inputs. If you don't know how to query a database I'd start with something simpler tbh! Running before you can walk and all that!
August 23, 200917 yr It's not something that can be explained and fully understood in a few minutes but this is the gist: $query = "SELECT field1, field2, field3 FROM table_name WHERE field1 = 'temporary'"; $result = mysql_query($query); $num = mysql_num_rows($result); if ($num > 0) { // print out results using mysql_fetch_array(); } else { // nothing was returned } You would need to dynamically make your query based on user input, and search gets a little more complex as for something like a job search you should really use FULL TEXT search. I reccomend a book, this one is good.
August 23, 200917 yr Author It's not something that can be explained and fully understood in a few minutes but this is the gist: $query = "SELECT field1, field2, field3 FROM table_name WHERE field1 = 'temporary'"; $result = mysql_query($query); $num = mysql_num_rows($result); if ($num > 0) { // print out results using mysql_fetch_array(); } else { // nothing was returned } You would need to dynamically make your query based on user input, and search gets a little more complex as for something like a job search you should really use FULL TEXT search. I reccomend a book, this one is good. hmmmm... how long will it take to make the entire script? If it doesn't take too long I'll pay someone to do it?
Create an account or sign in to comment