php mysql 多表查詢 查詢不出結果?該怎麼處理

來源:互聯網
上載者:User
php mysql 多表查詢 查詢不出結果?
My Code如下:
PHP code



結果就只顯示
Connected successfully
如果用
PHP code
$query="select * from jiraissue";

就會顯示相應的內容

php mysql多表查詢該怎麼寫?上面哪裡出錯了?

------解決方案--------------------
沒有表結構和真實資料,沒有真相。
你裝一個phpmyadmin,在裡面執行看看。
------解決方案--------------------
echo $row[0];

這裡改成 var_dump($row); 看看是否返回資料集正確
------解決方案--------------------
c.pname='TEST';";
不用把這個分號也複製進來
------解決方案--------------------
給點提示:
select co_balance,co_isstaff,staff_group_id,count from
(select co_balance,co_isstaff from dt_co where co_id=156) a,
(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

這是連結用了
dt_co 和 dt_staff 做的查詢
------解決方案--------------------
把你的sql指令在phpmyadmin執行能查出結果嗎?
------解決方案--------------------
你把你這個語句拿到資料庫裡面跑一下不就知道有不有問題了
------解決方案--------------------
先用mysql_error()和mysql_errno()看看錯誤提示!
------解決方案--------------------
把php檔案的編碼統一為資料庫的編碼試試看。 可能是編碼不一致導致的誤差。
------解決方案--------------------
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();}
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.