MySQL多表之间字段的匹配实现代码
2022-11-12 09:31:44
内容摘要
这篇文章主要为大家详细介绍了MySQL多表之间字段的匹配实现代码,具有一定的参考价值,可以用来参考一下。
对此感兴趣的朋友,看看idc笔记做的技术笔记!
代码如下:
$sql=$empi
文章正文
这篇文章主要为大家详细介绍了MySQL多表之间字段的匹配实现代码,具有一定的参考价值,可以用来参考一下。
对此感兴趣的朋友,看看idc笔记做的技术笔记!
代码如下:
1 2 3 4 5 6 7 8 9 | <code> $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' ]; } </code> |
代码如下:
1 2 3 | <code> select info.id, info.name from tag,info where info.name like ‘% '+tag.name+' %' </code> |
代码如下:
1 2 3 | <code> select info.id, info.name from tag,info where info.name like concat( '%' ,tag.name, '%' ) </code> |
注:关于MySQL多表之间字段的匹配实现代码的内容就先介绍到这里,更多相关文章的可以留意
代码注释