Why can't I find any results in phpmysql multi-table queries? My code is as follows: PHPcode & lt ;? Php/* connectdatabase */$ link = mysql_connect (& quot; 192.168.XX.XX: 3306 & quot;, & quot; root & quot;, & quot; r php mysql multi-table query results?
My code is as follows:
PHP code
The result is displayed only.
Connected successfully
If you use
PHP code
$query="select * from jiraissue";
The corresponding content is displayed.
Php mysql multi-table query how to write? What is the above error?
------ Solution --------------------
No table structure and real data, no truth.
You can install phpmyadmin and execute it in it.
------ Solution --------------------
Echo $ row [0];
Change var_dump ($ row) here to see if the returned dataset is correct.
------ Solution --------------------
C. pname = 'test ';";
You don't need to copy this semicolon.
------ Solution --------------------
Tip:
Select co_balance, co_isstaff, staff_group_id, count from
(Select co_balance, co_isstaff from dt_co where co_id = 156),
(Select staff_group_id from dt_staff where co_id = 156) B,
(Select count (*) as count from dt_staff where staff_shouyetuijian = 1 and co_id = 156) c
This is the link used
Query by dt_co and dt_staff
------ Solution --------------------
Can I find the result by executing your SQL command in phpmyadmin?
------ Solution --------------------
If you take your statement to the database and run it, you don't know if there is any problem.
------ Solution --------------------
Use mysql_error () and mysql_errno () to check the error message!
------ Solution --------------------
Try to unify the php file encoding into the database encoding. The error may be caused by inconsistent codes.
------ Solution --------------------
PHP code
$result=mysql_query($query,$link) or die("Query failed");echo "1 ".mysql_error();/*print result in html*/MySQL_num_rows($result);echo "2 ".mysql_error();while($row=mysql_fetch_array($result)){echo $row[0];echo "3 ".mysql_error();}