Why can't I find any results in phpmysql multi-table queries? What should I do?

Source: Internet
Author: User
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();}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.