所以我希望能够从数组中获取值并在SQL查询中使用它,并从这些行中获取信息.我目前的代码是这样的:
$config['exclude_devices'] = array('1','5');
Run Code Online (Sandbox Code Playgroud)
$exclude = $config['exclude_devices'];
foreach ($exclude as $excluded) {
$deviceinformation = mysqli_query($db, "SELECT * FROM `devices` WHERE `device_id` NOT IN(" . $excluded . ")");
}
while ($row = mysqli_fetch_assoc($deviceinformation)) {
// do stuff here
// write to a variable for use in a table
}
Run Code Online (Sandbox Code Playgroud)
但是,这给出了设备1,2,3,4的输出.
如果我移动foreach包括while,它产生2,3,4,5,1,2,3,4:
$exclude = $config['exclude_devices'];
foreach ($exclude as $excluded) {
$deviceinformation = mysqli_query($db, "SELECT * FROM `devices` WHERE `device_id` NOT IN(" . $excluded . ")");
while ($row …Run Code Online (Sandbox Code Playgroud) 如何在悬停时将图像更改为文本,并在鼠标离开时使用 HTML、CSS 和 JavaScript 再次返回?如果这有什么不同,我目前正在使用HTML5UP 的空中主题。