Warning: mysql_query(): supplied argument is not a valid MyS

ตอบกระทู้

รูปแสดงอารมณ์
: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] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: Warning: mysql_query(): supplied argument is not a valid MyS

Re: Warning: mysql_query(): supplied argument is not a valid MyS

โดย worrawooth » 21/03/2009 6:16 am

คับแก้ได้แล้วครับ

Re: Warning: mysql_query(): supplied argument is not a valid MyS

โดย ob1 » 21/03/2009 3:36 am

สองกระทู้ยังงหว่า.....
Warning: mysql_query ผมว่ามีหลายกระทู้้แล้วนะ ลองค้นดูบ้างยัง

Re: ช่วยหน่อยครับ

โดย worrawooth » 19/03/2009 8:49 pm

ขอถามทั้ง 2 กระทู้เลยครับ พอดี มันติดอยุ๋เลย

Re: ช่วยหน่อยครับ

โดย worrawooth » 19/03/2009 8:24 pm

$query = "SELECT news_title FROM t_news WHERE news_title = '$title'";
$rsCheck = mysql_db_query(CURRENT_DB, $query) or die(mysql_error());
//$total = mysql_db_query($rsCheck);
if($rsCheck<>0)
{
echo "ข้อมูลซ้ำ<br>";
}

//mysql_query("SET NAMES TIS620");
$insert ="INSERT INTO t_news (news_title ,news_description ,news_link ,news_date) VALUES ('".addslashes($title)."','".addslashes($description)."','".$link."','".$pubdate."')";
$ResultInsert= mysql_db_query(CURRENT_DB, $insert);

ผมตรวจสอบข้อมูลได้แล้วครับแต่ผมอยากให้ผม พอตรวจได้แล้วให้มันหยุด insert ข้อมูล ให้เลือกเอา เฉพาะข้อมูลที่ไม่ซ้ำ insert ลงไป ไม่ทราบว่าเขียนยังไงครับ

Warning: mysql_query(): supplied argument is not a valid MyS

โดย worrawooth » 19/03/2009 8:12 pm

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\AppServ\www\rsslib\rss-single.php on line 208

$query = "SELECT news_title FROM t_news WHERE news_title = '$title'";
$rsCheck = mysql_query($query, $db) or die(mysql_error());
$total = mysql_query($rsCheck);
if($total<>0)
{
echo "¢éÍÁÙÅ«éÓ";
}

โค้ด เลือกข้อมูลเพื่อจะดูว่าข้อมูลไหนซ้ำ

$hostname_service = "localhost";
$database_service = "dd";
$username_service = "root";
$password_service = "1234";
$db = mysql_pconnect($hostname_service, $username_service, $password_service) ;
mysql_query("SET NAMES TIS620");

โค้ด connect db

มัน error ตามข้างบนอะครับแก้ไง พอดีผมถามเยอะเพราะผมต้องการคนช่วยครับ ทำ project จบอยู๋ครับ
ขอบคุณครับ

ข้างบน