本文介绍了与数据库值比较并在PHP中查找搜索结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在url处理和城市中传递两个值from home.php
和show.php
我想根据这两个值显示数据如果找到
数据库城市列像德里(单值)但治疗栏就像prp,发烧,感染(单个单元格中的多个值)
我的问题是如何选择并显示url是否包含treatment = prp和city = mumbai
然后显示没有找到数据,因为城市有德里
我尝试过:
$ sql =SELECT * FROM add_doctor WHERE city ='。$ city。'AND treatment ='。$ treatment。';
解决方案
passing two values in url treatment and city from home.php
and in show.php
I want to display data according to these two values if found
in data base city column goes like Delhi(single value) but treatment column goes like prp, fever, infection(multiple values in single cell)
my problem is how to select and display if url consists treatment = prp and city = mumbai
then display no data found because city has delhi
What I have tried:
$sql = "SELECT * FROM add_doctor WHERE city='".$city."' AND treatment ='".$treatment."'";
解决方案
这篇关于与数据库值比较并在PHP中查找搜索结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!