สอบถามวิธีการนำข้อมูลที่กรองออกมาจากดาต้าเบสที่1 ไปค้นหาต่อในดาต้าเบสที่2 ครับดาต้าเบสที่1 เป็นเว็บฝากรูปครับ
https://github.com/lfiore/upld/ แล้วได้ทำหน้าเว็บสำหรับแสดงรายการรูปภาพล่าสุดออกมาเป็น
<?php
require('config.php');
require('common.php');
if (!isset($_SESSION['user']))
{
exit_message('You are no authorised to access this page. Please log in.');
}
$user = $_SESSION['user'];
require('db.php');
$page = isset($_POST["page"])? (int) $_POST["page"] : 0;
$images = mysqli_prepare($db, 'SELECT `id`, `ext`, `time` FROM `images` WHERE `removed` = "0" ORDER BY `time` desc limit '.$page.', 10 ' );
//mysqli_stmt_bind_param($images, 'i', $user);
mysqli_stmt_execute($images);
++$db_queries;
mysqli_stmt_store_result($images);
if (mysqli_stmt_num_rows($images) === 0)
{
exit_message('You haven\'t uploaded any images yet!');
}
mysqli_stmt_bind_result($images, $id, $ext, $time);
require('inc/header.php');
if (!defined('IN_SCRIPT'))
{
header('location: ../index.php');
exit;
}
?>
<div class="box">
<p class="title" style="text-decoration: underline;">Admin Column mode to View All Image</p>
<?php
echo'<table style="position: absolute;padding: 0 50px;"><thead>
<tr style="background-color: #a4ed34;">';
echo '<th style="width: 200px" scope="col">Image ID</th>';
echo '<th style="width: 200px" scope="col">uploaded</th>';
echo '<th style="width: 80px" scope="col">View</th>';
echo '<th style="width: 200px" scope="col">Search</th>';
echo '</tr></thead>';
while (mysqli_stmt_fetch($images))
{
echo '<tr>';
echo '<td>'. $id.'</td>';
echo '<td>'. $time .'</td>';
echo '<td><a target="_blank" rel="follow" href="' .VIEW_PATH . $id .'">GO</a></td>';
echo '<td> </td>';
echo '</tr>';
}
echo'</table>';
?>
<?php
mysqli_stmt_close($images);
mysqli_close($db);
?>
</div>
<?php
ต้องทำอย่างไรครับเพื่อให้นำ Image ID($id) จากรายการ > ไปค้นหาต่อในดาต้าเบสที่2 แล้วแสดงผลการค้นหาออกมาด้านหลังได้เลยไม่ต้องไปกดค้นหาที่ล่ะรายการอีกนะครับ