Search function in PHP

Source: Internet
Author: User
I want to achieve just start to display all the database table information, follow the input box query, only display the contents of the query, the rest does not appear, how to change it, I now only do the show all the information!!
Include ("inc/conn.php");
?>



<title>Test</title>
























if (!isset ($_post[' search ') | | Trim ($_post[' search ') = = ') {$_post[' search ']= '; } $find = $_post[' search ']; $result =mysql_query ("select * from job where title like '%". $inputkey. " %'"); while ($myrow =mysql_fetch_array ($result)) {?>
Position Company Number Professional




Reply to discussion (solution)

The form was wrongly written.

Change it.

$inputkey where is this variable obtained from?

There is no name in your line, and the form values accepted by PHP are accepted according to the name value.
The front page of our company is always written in this way without writing the name value ...

Input does not add the name attribute, how does PHP get it?


There is also a problem with the value query
$inputkey = isset ($_post[' Inputkey ')? $_post[' inputkey ': ';
$result =mysql_query ("select * from job where title like '%". $inputkey. " %'");

Thank you, the problem is solved, the final code is this
Include ("inc/conn.php");
?>



Test

























if (!isset ($_post[' search ') | | Trim ($_post[' search ') = = ') {//$_post[' search ']= ';//}//$find = $_post[' search ']; $inputkey = isset ($_post[' Inputkey ')? $_post[' inputkey ': '; $result =mysql_query ("select * from job where title like '%". $inputkey. " %'"); while ($myrow =mysql_fetch_array ($result)) {?>
Position Company Number Professional



  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.