Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
大家好
我有一个简单的 php 数组,例如:
$numbers=array("12345","65432","98765");
SQL表名为:“phones”,列为“ TNumbers ”,行数:654654、12345、87878。
现在,从 SQL Server 表中存在的数组中返回所有值的最快方法是什么?(所以它应该只返回这个:(“12345”))
非常感谢你!!
经过一番搜索,我找到了答案,对不起:
$ids = join(',',$numbers); $sql = "SELECT * FROM phones WHERE TNumbers IN ($ids)";
还是非常感谢!