You will have to get.class.php for giving help.
Working case(index.php spaghetti):
<?php
require_once 'classes/get.class.php';
$get = new Get();
$get->getSql("SELECT * FROM gunler ORDER BY g_id ASC LIMIT 0,15");
foreach($get->getData() as $data)
{
echo $data["g_name"];
}
?>
result of spaghetti:
18 January 2012
the successful in a sense.
Are not working case:
<?php
require_once 'get.class.php';
Class Main Extends Get
{
function __construct()
{
// boş
}
public function getGun($limit = 15, $sayfa = 1)
{
$limit1 = $limit * ($sayfa - 1);
$limit2 = $limit1 + $limit;
parent::getSql("SELECT * FROM gunler ORDER BY g_id ASC LIMIT " . $limit1 . "," . $limit2);
return parent::getData();
}
}
?>
$main = new Main();
print_r($main->getGun());
result of this:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\AppServ\www\dailypremium\classes\get.class.php on line 39
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\dailypremium\classes\get.class.php on line 55
Array ( )
I can't see any difference first codes between second codes. Where is the problem?