[ dejanv @ 06.12.2005. 23:56 ] @
Molio bih za pomoc oko primera koji sam pronasao na web-u.
U lokalu odlicno radi, ali na site-u ni da cuje. Izbacuje mi sledecu greku:

Fatal error: Class mysql_data_table: Cannot inherit from undefined class data_table in h:\home\users\FA05-04-08-01_nj8hg7cmvbbtzwehez22\sea-agency.com\public_html\baza\mysql_data_table.class.php on line 18

Site se nalazi na www.loopia.co.yu.
Ne znam sta nisam sve procitao, ali ne ide.
Dali ima nekoga sa dovoljno volje da pomogne.

Evo coda u kome mislim da je problem. Ima tu jos dva file-a.
<?php
/*
Class: mysql_data_table
Author: Sven Zurnieden
Email: [email protected]

Description:
This class is extending data_table class which generates a html-table from a dataset array.
For info on datatable look in data_table.class.php.
Just set the query and execute it.
Use then the methods of data_table class to change layout from table.

HAVE FUN NOW, hope this class is useful
*/

require_once("data_table.class.php");

class mysql_data_table extends data_table{

var $query = false; //the query

function set_query($query){
//sets the query
$this->query = $query;
}

function execute_query($db_host, $db_user, $db_pass, $db){
//executes the query
$connect = mysql_connect($db_host, $db_user, $db_pass);
mysql_select_db($db);
$query = mysql_query($this->query, $connect);
$i = 0;
while($result = mysql_fetch_array($query, MYSQL_ASSOC)){
$data[$i] = $result;
$i++;
}
$this->set_data($data);
}
}
?>
[ valeksa @ 07.12.2005. 09:07 ] @
Citat:

Code:

....
require_once("data_table.class.php");

class mysql_data_table extends data_table{
...




Ovde je problem. Fajl (mysql_data_table) ne vidi 'data_table.class.php'.

Po svoj prilici u tvom slucaju treba da stoji

Code:

....
require_once("\baza\data_table.class.php");



moras malo da se igras sa putanjama :(

problem je u include path variabli PHP setovanja.

Pogledaj i
[url]http://www.php.net/manual/en/function.ini-set.php[/url]

Pozdrav,
Vladan

[Ovu poruku je menjao valeksa dana 07.12.2005. u 10:08 GMT+1]

[Ovu poruku je menjao valeksa dana 07.12.2005. u 10:08 GMT+1]
[ dejanv @ 07.12.2005. 13:52 ] @
Probao sam da promenim i evo sta kaze:

Fatal error: main(): Failed opening required '\baza\data_table.class.php' (include_path='.;c:\php4\pear') in h:\home\users\FA05-04-08-01_nj8hg7cmvbbtzwehez22\sea-agency.com\public_html\baza\mysql_data_table.class.php on line 16

Ubijam se danima da provalim sta ne valja.
[ afwt @ 07.12.2005. 22:16 ] @
A sto ne probas prvo da inicijalizujes tu data_table klasu pre nego sto pokusas da definises tu drugu koja je nasledjuje?

Igraj se malo, vidi gde ce ti puci.
[ valeksa @ 08.12.2005. 08:14 ] @
Citat:
dejanv: Probao sam da promenim i evo sta kaze:

Fatal error: main(): Failed opening required '\baza\data_table.class.php' (include_path='.;c:\php4\pear') in h:\home\users\FA05-04-08-01_nj8hg7cmvbbtzwehez22\sea-agency.com\public_html\baza\mysql_data_table.class.php on line 16

Ubijam se danima da provalim sta ne valja.


probaj da stavis ovakvu konstrukciju ako ti je folder baza ispod webroot-a
Code:

require_once($_SERVER["DOCUMENT_ROOT"].'\baza\data_table.class.php');


ako nije,
probaj da setujes include_path sa ini direktivom i da includujes samo fajl 'data_table.class.php'

Ovo bi trebalo da radi.

Evo sta kaze manual...za svaki slucaj


Citat:

Files for including are first looked in include_path relative to the current working directory and then in include_path relative to the directory of current script. E.g. if your include_path is ., current working directory is /www/, you included include/a.php and there is include "b.php" in that file, b.php is first looked in /www/ and then in /www/include/. If filename begins with ./ or ../, it is looked only in include_path relative to the current working directory.


Pozdrav,
Vladan
[ sale83 @ 08.12.2005. 09:03 ] @
Evo testirao sam na localhostu + dva placena servera i na sva tri radi ta tvoja class-a !!!!


Tvoj problem je izgleda kako ti gore vec kazu u

require_once("data_table.class.php");



[ dejanv @ 09.12.2005. 01:35 ] @
Da, valeksa je bio u pravu.

Hvala, svima na pomoci.

Pozdrav