Jump to content


Photo

[Fatal error: Cannot instantiate non-existent class: in ...]


  • Please log in to reply
6 replies to this topic

#1 Cobra

Cobra
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 16 July 2003 - 06:31 PM

Hi everybody,

i need some help or i\'m getting crazy!!!!

I\'m running an
Apache/2.0.46 (Win32) mod_perl/1.99_10-dev Perl/v5.8.0 PHP/4.3.2 mod_ssl/2.0.46 OpenSSL/0.9.7b Server

with MySQL 3.23.49.

everytime i want to access a certain database under MySQL i get the following error message
[Fatal error: Cannot instantiate non-existent class: in ...]
I really don\'t know whats the Problem... Everything else runs fine

I thank everyone who can help me on this problem!

Additional infos can be given

greetings Cobra

#2 metalblend

metalblend
  • Members
  • PipPipPip
  • Advanced Member
  • 89 posts
  • LocationCalifornia, USA

Posted 16 July 2003 - 07:39 PM

This is under PHP, right?

The error is specific to the script attempting to initiate (call) a class and it did not exist. Something like this would be the cause for error:
<?php  class boo  {    # php, and more php here  }  $var = new boot;?>
A simple typo is to blame (here).

Can we see some code?

#3 MAPA3M

MAPA3M
  • Members
  • Pip
  • Newbie
  • 8 posts
  • LocationNew York

Posted 17 July 2003 - 09:13 AM

either that or you forgot to compile MySQL support into PHP
# cd /pub [br]# more beer

#4 Cobra

Cobra
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 17 July 2003 - 11:29 AM

First the Code:

<html><head>   <title>email an den Notdienst</title></head><body><?php	$eingang = date("d.m.Y");	if (($name=="") or ($anrufer=="") or ($lehrstuhl=="") or ($telefon=="") or ($beschreibung=="") or ($problem=="")):  print "Formular nicht vollständig ausgefüllt. Bitte klicken Sie auf den "zurück"-Knopf in Ihrem Browser; dann bleiben die bisher eingegebenen Daten erhalten.";	else:  echo "<table bgcolor="silver">";  echo "<TR><TD>";  echo "<b>Ihre Angaben an den Notdienst:</b><BR>";  echo "<pre>";	    $body="";    $body.="Name:                   ";    if ($name!=""):       $body.=$name;    endif;    $body.="n";    $body.="Auftraggeber:           ";    if ($anrufer!=""):       $body.=$anrufer;    endif;    $body.="n";    $body.="Lehrstuhl:              ";    if ($lehrstuhl!=""):       $body.=$lehrstuhl;    endif;    $body.="n";    $body.="Ruf:                    ";    if ($telefon!=""):       $body.=$telefon;    endif;    $body.="n";    if ((isset($email)) AND ($email!="")):       $body.="e-mail:                 ".$email;    else:    	$email="-kA-";       //$body.="-kA-";    endif;    $body.="n";    if ((isset($dringend)) AND ($problem!="")):       $body.="Problem:                ".$problem;    endif;    $body.="n";       if ((isset($dringend)) AND ($dringend="")):       $dringend="DRINGEND";    else:    	$dringend="eilt nicht";    endif;      $body.=$dringend."n";    $body.="Beschreibung:           ";    if ($beschreibung!=""):       $body.=$beschreibung."n";    endif;    if ((isset($termin)) AND ($termin!="")):       $body.="Termin:                 ".$termin;    else:    	$termin="-kA-";       //$body.="-kA-";    endif;    $body.="n";    if ((isset($datum)) AND ($datum!="")):       $body.="Terminwunsch/Datum:     ".$datum;    else:    	$datum="-kA-";       //$body.="-kA-";    endif;    $body.="n";    if ((isset($uhrzeit)) AND ($uhrzeit!="")):       $body.="Terminwunsch/Uhrzeit:   ".$uhrzeit;    else:    	$uhrzeit="-kA-";       //$body.="-kA-";    endif;    $body.="n";    if ((isset($telefon_spaeter)) AND ($telefon_spaeter!="")):       $body.="Rückruf:                ".$telefon_spaeter;    else:    	$telefon_spaeter="-kA-";       //$body.="-kA-";    endif;    $body.="n";    if ((isset($transportabel)) AND ($transportabel!="")):       $body.="Defekte Hardware KANN zum Notdienst gebracht werden: ".$transportabel;    else:    	$transportabel="-kA-";       //$body.="-kA-";    endif;    $body.="n";    if ((isset($versendet)) AND ($versendet!="")):       $body.="Defekte Hardware IST zum Notdienst gebracht worden: ".$versendet;    else:    	$versendet="-kA-";       //$body.="-kA-";    endif;    $body.="n";    if ((isset($transport_zum_haendler)) AND ($transport_zum_haendler!="")):       $body.="Defekte Hardware MUSS zum Händler gebracht werden: ".$transport_zum_haendler;    else:    	$transport_zum_haendler="-kA-";       //$body.="-kA-";  endif;    $body.="n";       if ((isset($garantiefall)) AND ($garantiefall!="")):       $body.="Garantiefall:           ".$garantiefall;    else:    	$garantiefall="-kA-";       //$body.="-kA-";    endif;    $body.="n";    if ((isset($austausch)) AND ($austausch!="")):       $body.="Defekte Hardware MUSS ausgetauscht werden: ".$austausch;    else:    	$austausch="-kA-";       //$body.="-kA-";    endif;      $body.="n";    $body.="Datum des Eingangs: ".$eingang;    $body.="n";    echo $body;    /********************************//******* Initialisierungen ******//********************************$result = new DB_Notdienst;    @Metalblend!!!!!! At this Point the script stop, like you said...!!!!$terminwunsch = $datum." ".$uhrzeit$q = "INSERT INTO anforderung (name,auftraggeber,lehrstuhl,telefon,email,problem,dringend,beschreibung,termin,terminwunsch,rueckrufnummer,transportabel,versendet,garantiefall,transport_zum_haendler,austausch,eingang) VALUES ("$name","$anrufer","$lehrstuhl","$telefon","$email","$problem","$dringend","$beschreibung","$termin","$terminwunsch","$telefon_spaeter","$transportabel","$versendet","$garantiefall","$transport_zum_haendler","$austausch","$eingang")";$result->query($q);          echo "</pre></TD></TR></table><P>Verschicke nun email an: notdienst@jura.uni-goettingen.de...</P>...Ergebnis:&nbsp;";    $ok = mail("notdienst@jura.uni-goettingen.de","Notdienstanfrage",$body);    if (! $ok)       echo "email konnte nicht versendet werden. Bitte versuchen sie es erneut!";    else       echo "alles okay, die email ist versendet worden!";      echo "<P>Wenn sich Änderungen an ihrer Anfrage ergeben, informieren sie bitte umgehend die Mitarbeiter im Notdienst unter der oben genannten email-Adresse oder unter Ruf 39-4411. Vielen Dank.</P>";    echo "<a href="http://www.jura.uni-goettingen.de"> http://www.jura.uni-goettingen.de</A>";   	endif;?></body></html>

@MAPA3M: I think in PHP 4.3.2 the MySQL-Support is build in.
@Metalblend: Notdienst is a MySQL-table. Could it be possible that the whole thing is a directory Problem. I changed the Structure of my serverinstallation.

greetings Cobra

#5 metalblend

metalblend
  • Members
  • PipPipPip
  • Advanced Member
  • 89 posts
  • LocationCalifornia, USA

Posted 17 July 2003 - 08:08 PM

As I had expected, your class is not defined or has not been included. Have you created this DB_Notdienst class? If so, you\'ll need to include() the source so the script can find the class and use your query() method.

If you need more help, let us know.
Hope that helps.

#6 Cobra

Cobra
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 22 July 2003 - 03:15 PM

Thanks for the help! :D

1. The script was written by another people, who is in holidays at this time, so it will be difficult to ask him about the include-file...

2. I\'m a little bit confused because the script worked until i installed the new PHP installation... Are they classes which are always accesable??
Or is it possible to include classes without the include-command?

A little bit confused

Cobra :?

#7 metalblend

metalblend
  • Members
  • PipPipPip
  • Advanced Member
  • 89 posts
  • LocationCalifornia, USA

Posted 22 July 2003 - 07:27 PM

If the class is written in its own file (which it should naturally be ;) ) you would include it, otherwise the class can be defined in the script itself. It looks like you might be missing that file.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users