why do this not create a database?

From: Dicki Smits (dicki_at_absoluut.org)
Date: 10/02/04

  • Next message: Paul Barfoot: "Re: why do this not create a database?"
    Date: 2 Oct 2004 00:34:19 -0700
    
    

    I am learning php-mysql but I typed the following into my notepad but
    it seems not to work. The page will be shown correct in the brouwser
    but it don't create a databse ????

    I use easyphp packet. php 4.3.3 ,mysql 4.0.15 . and apache 1.3.27

    any help would be great.
    greatings Dicki Smits

    ****
    <html>
    <title>hello world</title>

    <body>

    <?php

    $host = "localhost";
            $user = "root";
            $pswd = "";

            mysql_connect($host,$user,$pswd) or die(mysql_error());
            mysql_select_db ("fotoboek");
            mysql_query ("create table nie1uws ( id integer,
                                                                                     title varchar(255),
                                                                                     date integer,
                                                                                     text blob)");

            mysql_connect($host,$user,$pswd) or die(mysql_error());
            mysql_select_db ("fotoboek");
            mysql_query ("INSERT TO nieuws values ( 1,
                                                                                            'tweede cursus',
                                                                                            5/5/2004,
                                                                                            'een nieuwe cursus...')");
                                                                                    
            mysql_query ("INSERT TO nieuws values (2,'tweede
    cursus',5/5/2004,'een nieuwe cursus...')");
            mysql_connect($host,$user,$pswd) or die(mysql_error());
            mysql_select_db ("fotoboek");
    $result = mysql_query("select * from nieuws where id=1");
    echo $result

    ?>
    Waarom zie ik niet dat er geen database is aangemaakt?
    </body>
    </html>


  • Next message: Paul Barfoot: "Re: why do this not create a database?"
  • Quantcast