鍍金池/ 問答/PHP  數(shù)據(jù)庫/ php與數(shù)據(jù)庫的問題

php與數(shù)據(jù)庫的問題

在數(shù)據(jù)庫執(zhí)行是有結(jié)果的
clipboard.png
但是換成php mysql執(zhí)行就沒有結(jié)果了
$sql = "SELECT goods.*,seller.name name2,brand,regionId FROM goods,seller where goods.seid = seller.seid and goods.type='$goodstype'".$_SESSION'goodsFilter';
var_dump($sql)的結(jié)果
clipboard.png

$sql2 = "SELECT goods.*,seller.name name2,brand,regionId FROM goods,seller where goods.seid = seller.seid and goods.type='新品出售' and seller.brand in ('小米')";
var_dump($sql2)

clipboard.png
求大神看一看,快哭了
不知道長度為啥不一樣,應(yīng)該排除空格

回答
編輯回答
菊外人

已經(jīng)解決了,謝謝

2018年5月5日 21:52
編輯回答
久舊酒

首先看一下你的數(shù)據(jù)庫選對沒,然后給所有的字段加上 `` 排除一下關(guān)鍵字 試試,最大可能就是數(shù)據(jù)庫選擇的不對吧

2017年8月26日 12:10