<?phpheader("Content-Type: text/html;charset=utf-8");$servername = "localhost";$username = "root";$password = "168168";$dbname = "mypet"; //資料庫名稱
// 建立連線$conn = new mysqli($servername, $username, $password, $dbname);$conn->query('set names utf8');// Check connectionif ($conn->connect_error) { die("連線失敗: " . $conn->connect_error);} $sql = "SELECT * FROM `user`";//sql = "SELECT * FROM ` mypet`";// $sql = "SELECT * FROM `ggbond`";//查詢語句$result = $conn->query($sql);$arr=Array();$arr1=Array(); if ($result->num_rows > 0) { // 輸出資料 while($row = $result->fetch_assoc()) { $arr=array( 1Name 'PersonalName'=$Name'$ 'AddPet_PetName_b'=>$row['AddPet_PetName_b'], 'IssueText'=>$row['IssueText'], 'Like'=>$點['Like']
'Like'=>$ /ike']
什麼意思?下次貼程式碼,截圖貼,如果是想聯表查用join,如果是兩個無關聯的表就查2次唄 https://www.runoob.com/mysql/mysql-join.html 這是聯表查的教學