以下代码导致错误:
mysqli_fetch_array()期望参数1为mysqli_result,布尔值在...中给出
private static final String NOTIFICATION_CHANNEL_ID ="notification_channel_id";
private static final String NOTIFICATION_Service_CHANNEL_ID = "service_channel";
.....
private void startInForeground() {
int icon = R.mipmap.icon;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
icon = R.mipmap.icon_transparent;
}
Intent notificationIntent = new Intent(this, CurrentActivity.class);
PendingIntent pendingIntent=PendingIntent.getActivity(this,0,notificationIntent,0);
NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
.setSmallIcon(icon)
.setContentIntent(pendingIntent)
.setContentTitle("Service")
.setContentText("Running...");
Notification notification=builder.build();
if(Build.VERSION.SDK_INT>=26) {
NotificationChannel channel = new NotificationChannel(NOTIFICATION_Service_CHANNEL_ID, "Sync Service", NotificationManager.IMPORTANCE_HIGH);
channel.setDescription("Service Name");
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.createNotificationChannel(channel);
notification = new Notification.Builder(this,NOTIFICATION_Service_CHANNEL_ID)
.setContentTitle("Service")
.setContentText("Running...")
.setSmallIcon(icon)
.setContentIntent(pendingIntent)
.build();
}
startForeground(121, notification);
}
我想在html网页中从一个表中回显if(isset($_GET['report'])) {
$order_id = ($_GET['report']);
$sql = "SELECT * FROM order_database WHERE id=$order_id;";
$sql .= "SELECT * FROM samples_database WHERE order_id=$order_id;";
$sql .= "SELECT * FROM results_database WHERE order_id=$order_id;";
$rec = mysqli_multi_query($conn, $sql);
$record = mysqli_fetch_array($rec);
$order_number = $record['order_number'];
$env_sam_id = $record['env_sam_id'];
}
,并从另一个表中回显$order_number
。我之前已经运行过这样的MySQL查询,并且该查询有效,但我不知道为什么这个查询无法正常工作。