anna: undefined constant

Hallochen,

habe jetzt apache, php und mysql zum laufen gebracht, aber noch folgendes problem, wenn ich mich mit der DB verbinden möchte. (Die Verbindung kommt zustande - aber undefined constant)

-----------------------------------------------------------------

Notice: Use of undefined constant localhost - assumed 'localhost' in C:\WAMP\Apache2.2\htdocs\connect.php on line 7

Notice: Use of undefined constant root - assumed 'root' in C:\WAMP\Apache2.2\htdocs\connect.php on line 7

Notice: Use of undefined constant test12 - assumed 'test12' in C:\WAMP\Apache2.2\htdocs\connect.php on line 7
Verbindung wurde aufgebaut
In der Variable steht folgendes: Resource id #2
-----------------------------------------------------------------

Das ist das Script:

-----------------------------------------------------------------
<?php
    error_reporting(E_ALL);

// Konfigurationsdatei laden

$db_link = mysql_connect(localhost, root, test12);

if($db_link) {
        echo "Verbindung wurde aufgebaut<br />\n";
        echo "In der Variable steht folgendes: ".$db_link;
    } else {
        echo "Es konnte keine Verbindung aufgebaut werden";
    }
?>

-----------------------------------------------------------------

Könnt Ihr mir weiterhelfen?

Vielen Dank

Eure Anna

  1. Jo... versuch doch mal
    $db_link = mysql_connect("localhost", "root", "test12");

    geht das etwas besser?

    1. hey steelii
      vielen dank

      1. Hello,

        vielen dank

        hast du auch _verstanden_ was das Problem ist? Sonst war der Tipp nämlich nicht von dauerhafter Wirkung...

        MfG
        Rouven

        --
        -------------------
        "I wish it need not have happened in my time" - "So do I, and so do all who live to see such times. But that is not for them to decide. All we have to decide is what to do with the time that is given us."  --  J.R.R. Tolkien: "The Lord Of The Rings: The Fellowship Of The Ring"