Jump to content

Warning: mysql_fetch_array() expects parameter 1 to be resource


whayooe

Recommended Posts

i have the syntax to display the article but there is a problem in his line 5 ..

anyone can help me.

 

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\json-parsingxml2\artikel-xml.php on line 5

{"agenda" : []}

 

 

<?php

include("koneksi.php");

$q = mysql_query('SELECT * FROM agenda');

$v = '{"agenda" : [';

while($r=mysql_fetch_array($q))

{

$ob = array('"','<br>','</br>');

 

$v .= '{"id" : "'.$r['id_agenda'].'",

"tema" : "'.str_replace($ob,' ',strip_tags($r["tema"])).'",

"isi_agenda" : "'.str_replace($ob,' ',strip_tags($r["isi_agenda"])).'",

"tempat" : "'.str_replace($ob,' ',strip_tags($r["tempat"])).'",

"pengirim" : "'.str_replace($ob,' ',strip_tags($r["pengirim"])).'",

"tgl_mulai" : "'.str_replace($ob,' ',strip_tags($r["tgl_mulai"])).'",

"tgl_selesai" : "'.str_replace($ob,' ',strip_tags($r["tgl_selesai"])).'",

"jam" : "'.str_replace($ob,' ',strip_tags($r["jam"])).'"}';

 

}

$v .= ']}';

echo $v;

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.