通过php搜索匹配MYSQL表中的两个字段 [英] Match two fields in MYSQL table via php search

查看:71
本文介绍了通过php搜索匹配MYSQL表中的两个字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在努力做一个工作板。


我已经制作了两个搜索框:


1 /职位名称

2 /位置


我为招聘人员制作了一个样机表格,将他们的工作数据输入我的数据库。


如何链接表格中的两个字段,以便搜索时的职位名称与位置匹配?


该表包含


msg_id |名字|位置| msg


名称是''职称''的表格字段


代码如下:



谢谢!


James

Hi,

I am trying to make a job board.

I have made two search boxes:

1/ Job Title
2/ Location

I have made a mockup form for the recruiters to input their job data into my database.

How do I link up two of the fields from the table so the job title when searched is matched up with the location?

The table consists of

msg_id | name | location | msg

Name is the table field for ''Job Title'' by the way

The code is below:


Thanks!

James

展开 | 选择 | 换行 | 行号

推荐答案

您的意思是名称字段中的职位名称和位置字段中的位置吗?您可以在SQL的where子句中使用AND来使用两个条件。
Do you mean match Job Title in the name field and Location in the location field? You can use AND in the SQL''s where clause to use two criteria.


您好,


是的,例如有人说搜索:


接待员在职位标题搜索框和肯特中。在位置搜索框中单击提交,显示的唯一结果是涉及接待员的数据。和肯特在它的表格行


谢谢!


詹姆斯
Hi there,

Yes so say for instance someone searches:

"Receptionist" in the Job title search box and "Kent" in the location search box and click submit, the only results that show is data that involves "receptionist" and "kent" in its table row

Thanks!

James


我也需要这样做搜索框,所以每个人都引用它的某些属性,所以一个只回答名称,一个回答位置?
Also do I have to so anything to the search boxes so each one refers to its certain properties so one only answers to name and one to location?


这篇关于通过php搜索匹配MYSQL表中的两个字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆