Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Guestbook – PHP/MySql [Solved]

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #28830
    Devilelites
    Member

    Hey guys,

    I followed a tutorial about making a guestbook. But it doesn’t really work… Heres the codes, I hope you have a soloution.

    Make answer/view answers:

    Code:


    Navn:


    Besked:



    “;
    }
    ?>

    “;
    echo “” . $data[“navn”];
    echo “

    “;
    echo $data[“dato”];
    echo “
    “;
    echo nl2br($data[“besked”]); //nl2br = newline oversættes til html breaktag.
    echo “

    Page where form directs to:

    Code:
    Indlægget findes allerede, og blev ikke gemt igen.“;
    }else{
    $dato_array=getdate(); //php datofunktion
    $dato = $dato_array[“mday”] . “/” . $dato_array[“mon”] . ” – ” . $dato_array[“year”];
    mysql_query(“INSERT INTO bog(navn, dato, besked) VALUES(‘$navn’,’$dato’,’$besked’)”); //data skrives til tabellen bog
    }
    }
    }
    ?>

    #71385
    Rob MacKay
    Participant

    Well – as far as I can see you are making a query to display the results of the mySQL request without making a connection first.

    Code:
    “;
    echo “” . $data[“navn”];
    echo “

    “;
    echo $data[“dato”];
    echo “ “;
    echo nl2br($data[“besked”]); //nl2br = newline oversættes til html breaktag.
    echo “

    “;
    }
    ?>

    You have no connection details there just a query.

    #74658
    Devilelites
    Member

    That might be right, and I guess that’s the problem. Can you help me to make it? As I said, it’s a tutorial, and I dont know anything about MySQL.

    I would be very glad, if you would – and thank’s for the response :)

    #75293
    KimmieA
    Member

    You can follow pretty well. You should be able to just google how to make the connection. I know you said you don’t know anything about it, but it is always fun to learn something new!

    Dog Training

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.