Jump to content

Recommended Posts

Hey Everyone!

 

i just need a push in the right direction - whether that be a tutorial/website/script page etc

 

I'm looking at re-designing a website and adding some php functionality to it. How would i go about creating a search like this page: http://www.stafforgserv.com.au/TeacherJobSearch.htm

note: the current search doesn't work but thats the same kind of set-up that i'll be working on

 

this can be done with one table right?

 

thanks!

Link to comment
https://forums.phpfreaks.com/topic/55361-simple-search/
Share on other sites

Well that kind of table isn't so much a search as it is calling up data that specifically coorelates to it.

 

Example:

 

<?php

//Lets say you're form POST variables are apples, oranges, and noodles

connect_to_my_database();

$my_mysql = mysql_query( "SELECT * FROM myTable WHERE myAppleColumn = '$apples' AND myOrangeColumn = '$oranges' AND myPastaColumn = '$noodles'" )
                    or die( mysql_error() );

while( $row = mysql_fetch_array( $my_mysql ) ){

    $myReturnedID = $row['myIDorKeyColumn'];

    //Alternatively you can add this if you want multiple results
    $myEchoVar .= $myReturnedID;

}

echo( $myEchoVar );

?>

 

Hope this is also a gentle push in the right direction, do check the google results above though

 

 

Link to comment
https://forums.phpfreaks.com/topic/55361-simple-search/#findComment-273673
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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