使用PHP执行关键字搜索


Perform keyword search using PHP

我有三个关键字字段,如关键字1、关键字2、关键字3,它们之间有和/或作为下拉运算符。

<tr>
    <td>Keywords:</td>
        <td><input name="keyword1" type="text" id="keyword1" /></td>
        <td>
           <select id="operator1" name="operator1">
               <option value="and">AND</option>
               <option value="or">OR</option>
           </select>
       </td>
       <td><input name="keyword2" type="text" id="keyword2" /></td>
       <td>
           <select id="operator2" name="operator2">
               <option value="and">AND</option>
               <option value="or">OR</option>
           </select>
       </td>
       <td><input name="keyword3" type="text" id="keyword3" /></td>
   </tr>

现在,如果我点击搜索,搜索应该会检查和/或的所有可能性,并产生结果。

应该搜索数组元素的所有匹配单词,比如我有array([0]=>array([0]=>Javascript Application Developer[1]=>工作描述:我的客户正在寻找应用程序)等等…

我需要一种只使用PHP的动态方式。。

如有任何帮助,我们将不胜感激。提前感谢。

search.onclick = function(){ //ajax request to an validation.php file }

在validation.php中,接受ajax请求发送的那些变量。

连接到数据库。根据您的需要提出查询。

对于ajax、mysql+php、sql,请检查w3schools.com