Jump to content

Archived

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

Cobra

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

Recommended Posts

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

either that or you forgot to compile MySQL support into PHP

Share this post


Link to post
Share on other sites

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: ";

   $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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 :?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

×

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.