從具有不同列名的兩個不同表中選擇所有列,並使用PHP在一個HTML表中打印結果。mysql從不同的列中選擇所有來自兩個不同列表的所有列表
$sql=mysqli_query($conn,"SELECT* from tbl_staff where db_user='$user'
uninon
SELECT* from tbl_activities where db_transferredto='$name'")or die(mysqli_error($conn));
錯誤:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'uninon SELECT* from tbl_activities where db_transferredto=' mohamad salimi'' at line 2
其'union'不'uninon' select'之間' –
給空間'*''SELECT *'' – Saurabh
$ SQL = mysqli_query($康恩,「SELECT * from tbl_staff where db_user ='$ user'union SELECT * from tbl_activities where db_transferredto ='$ name'」)or die(mysqli_error($ conn));' –