国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

MySQL多表之間字段的匹配實現代碼

2024-07-24 12:40:59
字體:
來源:轉載
供稿:網友
復制代碼 代碼如下:     $sql=$empire->query("select table.title,lianxi,table.dizhi,table.id from table,table1 where table1.sid like concat( '%|',table.id,'|%') and table1.id=".$navinfor[id]."");  while($r=$empire->fetch($sql))  {  $title=$r['title'];  $lianxi=$r['lianxi'];  $dizhi=$r['dizhi'];  }      如下:兩個表info,tag  info 表  id name  1 aa和bb  2 bb和cc  3 ee和dd  tag表  1 aa  2 bb  tag表中 name 匹配 info 中的name  這樣寫就有問題:  復制代碼 代碼如下:     select info.id, info.name from tag,info where info.name like ‘%'+tag.name+'%'      正確:  復制代碼 代碼如下:     select info.id, info.name from tag,info where info.name like concat( '%',tag.name, '%')   
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 东乡族自治县| 灵寿县| 庆云县| 洛扎县| 南康市| 凤山县| 衡南县| 财经| 澄城县| 蒙城县| 武陟县| 共和县| 东安县| 固阳县| 盐亭县| 韩城市| 兴海县| 桦川县| 连城县| 蕲春县| 瑞金市| 通海县| 无锡市| 福海县| 武功县| 庄河市| 祥云县| 通榆县| 汉中市| 梨树县| 西吉县| 句容市| 石门县| 洛扎县| 绵竹市| 九龙坡区| 胶州市| 拜泉县| 汶川县| 清河县| 广东省|