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.
如何在 SQL 查询中将字符串与 PHP 变量连接起来?
例子:
select User from users where id="badge_name""$user_id"
请写一个badge_name与user_id字符串连接的代码示例。其实我忘了我上次是怎么做到的,就像“你好”。用其他一些字符串。请更具体...谢谢
badge_name
user_id
<?php $sql_query = " SELECT `User` FROM `users` WHERE `id` = '" . $badge_name . $user_id "' "; ?>
$id = "badge_name".$user_id; mysqli_query("select User from users where id='$id'");