ตรวจ code php mysql ให้ทีครับ Warning: mysql_num_rows(): supplied argument is no

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: ตรวจ code php mysql ให้ทีครับ Warning: mysql_num_rows(): supplied argument is no

Re: ตรวจ code php mysql ให้ทีครับ Warning: mysql_num_rows(): supplied argument is no

โดย Dwight » 12/12/2011 10:07 pm

ขอบคุณทุกท่านมากครับ ตอนนี้รันได้แล้วครับ

Re: ตรวจ code php mysql ให้ทีครับ Warning: mysql_num_rows(): supplied argument is no

โดย touleg » 10/12/2011 2:58 pm

from = จาก
form = แบบฟอร์ม

แก้ถูกหรือยังครับ ให้เปลี่ยนเป็น from นะ

Re: ตรวจ code php mysql ให้ทีครับ Warning: mysql_num_rows(): supplied argument is no

โดย mindphp » 09/12/2011 11:28 am

เช็คว่าตารางที่ query มีอยู่จริงในฐานข้อมูลหรือเปล่า

Re: ตรวจ code php mysql ให้ทีครับ Warning: mysql_num_rows(): supplied argument is no

โดย Dwight » 09/12/2011 11:11 am

มันก็ยังเป็นเหมือนเดิมอ่ะ error Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\AppServ\www\website\phpsql.php on line 16
result =

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in D:\AppServ\www\website\phpsql.php on line 20

Re: ตรวจ code php mysql ให้ทีครับ Warning: mysql_num_rows(): supplied argument is no

โดย Dwight » 09/12/2011 10:45 am

ขออภัยครับ มือใหม่

Re: ตรวจ code php mysql ให้ทีครับ Warning: mysql_num_rows(): supplied argument is no

โดย mindphp » 09/12/2011 10:33 am

รูปแบบ

โค้ด: เลือกทั้งหมด

select * from table

ตรวจ code php mysql ให้ทีครับ Warning: mysql_num_rows(): supplied argument is no

โดย Dwight » 09/12/2011 9:57 am

ตอนนี้เรียนการเชื่อฐานข้อมูล php mysql อยู่ แต่พอรันโค้ดแล้วมันไม่โชว์ Database
ทำเป็นระบบเว็บบอร์ด
มัน error

Connection is OK!!
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\AppServ\www\website\phpsql.php on line 16
result =

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in D:\AppServ\www\website\phpsql.php on line 20

โค้ด: เลือกทั้งหมด

<?
        $link=mysql_connect("localhost","root","lorenciaz");
        if(!$link)
        {
            print("<b>Error connect to mysql</b>");
        }
        else
        {
            print("<b>Connection is OK!!</b>");

            mysql_select_db("webboard",$link);
            
            $cmd="select * form webboard_topic ";
            $result=mysql_query($cmd,$link);
            
            $num=mysql_num_rows($result);

            print("result = $num<br>");

            while ($row=mysql_fetch_row($result))
            {
                print("Data = $row[0], $row[1], $row[2], $row[3], $row[4]<br>");
            }
            
        }

        mysql_close($link);
?>

ข้างบน