Senin, 14 Oktober 2013

PHP Indonesia - Facebook: gan ini yang eror apanya?

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
Learning HTML & CSS shouldn't be difficult.

Master Trainer, Mark Lassoff, will teach you everything you need to know to create a creative and professional web site in 4 hours.
From our sponsors
gan ini yang eror apanya?
Oct 14th 2013, 16:23, by Eka Bayu Nursigit

Eka Bayu Nursigit 4:23pm Oct 14
gan ini yang eror apanya?

Eka Bayu Nursigit 4:24pm Oct 14
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\app\tpl\class.forms.php on line 86

Jody 4:36pm Oct 14
itu kalo ga salah querynya deh gan

Eka Bayu Nursigit 4:36pm Oct 14
nah harus di benerinya di php atau di sql database

Jody 4:37pm Oct 14
di phpnya gan.. coba share dimari codenya

Eka Bayu Nursigit 4:38pm Oct 14
oke gan

Eka Bayu Nursigit 4:38pm Oct 14
<?php

namespace Revolution;
if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); }
class forms implements iForms
{

public $error;

final public function setData()
{
global $engine;
foreach($_POST as $key => $value)
{
if($value != null)
{
$this->$key = $engine->secure($value);
}
else
{
$this->error = 'Please fill in all fields';
return;
}
}

}

final public function unsetData()
{
global $template;
foreach($this as $key => $value)
{
unset($this->$key);
}
}

final public function writeData($key)
{
global $template;
echo $this->$key;
}

final public function outputError()
{
global $template;
if(isset($this->error))
{
echo "<div id='message'> " . $this->error . " </div>";
}
}

/* Manage different pages */

final public function getPageNews()
{
global $template, $engine;

if(!isset($_GET['id']) || !is_numeric($_GET['id']))
{
$_GET['id'] = 1;
}
$result = mysql_query("SELECT title, id FROM cms_news WHERE id != '" . $engine->secure($_GET['id']) . "' ORDER BY id DESC");

while($news1 = mysql_fetch_array($result))
{
$template->setParams('newsList', '&laquo; <a href="index.php?url=news&id='.$news1["id"].'">' . $news1['title'] . '</a><br/>');
}

$news = $engine->fetch_assoc("SELECT title, longstory, author, published FROM cms_news WHERE id = '" . $engine->secure($_GET['id']) . "' LIMIT 1");
$template->setParams('newsTitle', $news['title']);
$template->setParams('newsContent', $news['longstory']);
$template->setParams('newsAuthor', $news['author']);
$template->setParams('newsDate', date("d-m-y", $news['published']));

unset($result);
unset($news1);
unset($news);
}

final public function getPageHome()
{
global $template, $engine;
$a = 1;
$data = mysql_query("SELECT title, id, published, shortstory, image FROM cms_news ORDER BY id DESC LIMIT 5");

while($news = mysql_fetch_array($data, MYSQL_ASSOC))
{
$template->setParams('newsTitle-' . $a, $news['title']);
$template->setParams('newsID-' . $a, $news['id']);
$template->setParams('newsDate-' . $a, date("d-m-y", $news['published']));
$template->setParams('newsCaption-' . $a, $news['shortstory']);
$template->setParams('newsIMG-' . $a, $news['image']);
$a++;
}
unset($news);
unset($data);
}

}

?>

Ali Syarudin 4:38pm Oct 14
lihat baris 86 di file class_forms.phpnya tuh

Jody 4:39pm Oct 14
line 86 yang mana gan?

Eka Bayu Nursigit 4:39pm Oct 14
while($news = mysql_fetch_array($data, MYSQL_ASSOC))

Ali Syarudin 4:40pm Oct 14
gk itu eksa error kan di line 86

Jody 4:40pm Oct 14
coba cek di query ini "SELECT title, id, published, shortstory, image FROM cms_news ORDER BY id DESC LIMIT 5

Eka Bayu Nursigit 4:41pm Oct 14
oke

Jody 4:41pm Oct 14
test query itu ke mysql

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar