Image storing in database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pescott

    Image storing in database

    Hello people, I could really use your help on this one... I have script
    to upload image data to a database, but all that is uploaded is the
    decription, not the data BLOB itself. There must be something wrong
    with the code that fread() and fopen() the file, but what?

    The inclusion file below, which diplays the form:

    <?php
    print ("<table>");
    print ("<tr>");
    print ("<td><form method=POST action=xhandlea anbod.php
    enctype=multipa rt/form-data>");
    print ("Omschrijving: ");
    print ("</td>");
    print ("<td><input type=text name=form_descr iption1 size=25>");
    print ("</td>");
    print ("</tr>");
    print ("<tr>");
    print ("<td><input type=hidden name=MAX_FILE_S IZE value=1000000>" );
    print ("Bestand:") ;
    print ("</td>");
    print ("<td><input type=file name=form_data1 size=25>");
    print ("</td>");
    print ("</tr>");
    print ("</table>");
    ?>


    And handling it, I use 5 of these includes, numbered accordingly

    <?
    $data1 = addslashes(frea d(fopen($form_d ata1, "r"),
    filesize($form_ data1)));
    $data2 = addslashes(frea d(fopen($form_d ata2, "r"),
    filesize($form_ data2)));
    $data3 = addslashes(frea d(fopen($form_d ata3, "r"),
    filesize($form_ data3)));
    $data4 = addslashes(frea d(fopen($form_d ata4, "r"),
    filesize($form_ data4)));
    $data5 = addslashes(frea d(fopen($form_d ata5, "r"),
    filesize($form_ data5)));

    $query = "INSERT into $Tabelnaam &
    #40;description 1,bin_data1,fil ename1,filesize 1,filetype1,des cription2,bin_d ata2,
    filename2,files ize2,filetype2, description3,bi n_data3,filenam e3,filesize3,fi letyp
    e3,description4 ,bin_data4,file name4,filesize4 ,filetype4,desc ription5,bin_da ta5,f
    ilename5,filesi ze5,filetype5) values ('$form_descrip tion1',
    '$form_data1', '$form_data1_na me', '$form_data1_si ze',
    '$form_data1_ty pe', '$form_descript ion2', '$form_data2',
    '$form_data2_na me', '$form_data2_si ze', '$form_data2_ty pe',
    '$form_descript ion3', '$form_data3', '$form_data3_na me',
    '$form_data3_si ze', '$form_data3_ty pe', '$form_descript ion4',
    '$form_data4', '$form_data4_na me', '$form_data4_si ze',
    '$form_data4_ty pe', '$form_descript ion5', '$form_data5',
    '$form_data5_na me', '$form_data5_si ze', '$form_data5_ty pe')";
    ?>

    Then I get all these warmings, an entry is made to the database, but
    the data BLOB fields in there remain empty:

    Warning: fopen("", "r") - Success in /xhandleaanbod.p hp on line 100

    Warning: stat failed for (errno=2 - No such file or directory) in
    /xhandleaanbod.p hp on line 100

    Warning: fread(): supplied argument is not a valid File-Handle resource
    in /xhandleaanbod.p hp on line 100

    Warning: fopen("", "r") - No such file or directory in
    /xhandleaanbod.p hp on line 101

    Warning: stat failed for (errno=2 - No such file or directory) in
    /xhandleaanbod.p hp on line 101

    Warning: fread(): supplied argument is not a valid File-Handle resource
    in /xhandleaanbod.p hp on line 101

    Warning: fopen("", "r") - No such file or directory in
    /xhandleaanbod.p hp on line 102

    Warning: stat failed for (errno=2 - No such file or directory) in
    /xhandleaanbod.p hp on line 102

    Warning: fread(): supplied argument is not a valid File-Handle resource
    in /xhandleaanbod.p hp on line 102

    Warning: fopen("", "r") - No such file or directory in
    /xhandleaanbod.p hp on line 103

    Warning: stat failed for (errno=2 - No such file or directory) in
    /xhandleaanbod.p hp on line 103

    Warning: fread(): supplied argument is not a valid File-Handle resource
    in /xhandleaanbod.p hp on line 103

    Warning: fopen("", "r") - No such file or directory in
    /xhandleaanbod.p hp on line 104

    Warning: stat failed for (errno=2 - No such file or directory) in
    /xhandleaanbod.p hp on line 104

    Warning: fread(): supplied argument is not a valid File-Handle resource
    in /xhandleaanbod.p hp on line 104
    De opdracht is:
    1
    De opdracht is met succes uitgevoerd!
    Something tells me there should be more to it to read and upload a
    filem, but don't know what it is...

    Thanks!

  • Andy Hassall

    #2
    Re: Image storing in database

    On 23 Apr 2005 04:48:01 -0700, "pescott" <google@pescott .com> wrote:
    [color=blue]
    >Hello people, I could really use your help on this one... I have script
    >to upload image data to a database, but all that is uploaded is the
    >decription, not the data BLOB itself. There must be something wrong
    >with the code that fread() and fopen() the file, but what?
    >
    >The inclusion file below, which diplays the form:
    >
    ><?php
    >print ("<table>");
    >print ("<tr>");
    >print ("<td><form method=POST action=xhandlea anbod.php
    >enctype=multip art/form-data>");
    >print ("Omschrijving: ");
    >print ("</td>");
    >print ("<td><input type=text name=form_descr iption1 size=25>");
    >print ("</td>");
    >print ("</tr>");
    >print ("<tr>");
    >print ("<td><input type=hidden name=MAX_FILE_S IZE value=1000000>" );
    >print ("Bestand:") ;
    >print ("</td>");
    >print ("<td><input type=file name=form_data1 size=25>");
    >print ("</td>");
    >print ("</tr>");
    >print ("</table>");
    >?>
    >
    >
    >And handling it, I use 5 of these includes, numbered accordingly
    >
    ><?
    >$data1 = addslashes(frea d(fopen($form_d ata1, "r"),
    >filesize($form _data1)));[/color]

    That's not how you handle file uploads. Read:



    --
    Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • pescott

      #3
      Re: Image storing in database

      I read it, but honestly, I don't know where the upload form supplied
      differs from mine. The filename is displayed, and the filename is
      inserted as a BLOB, but have no clue where things are going astray. The
      script was taken from a tutorial.

      Comment

      • Andy Hassall

        #4
        Re: Image storing in database

        On 23 Apr 2005 05:46:44 -0700, "pescott" <google@pescott .com> wrote:
        [color=blue]
        >I read it, but honestly, I don't know where the upload form supplied
        >differs from mine. The filename is displayed, and the filename is
        >inserted as a BLOB, but have no clue where things are going astray. The
        >script was taken from a tutorial.[/color]

        The problem's not in the form, it's how you're processing the files, and many
        other issues. If this came from a tutorial, it is a very poor tutorial. See
        other reply where I've gone into more detail.

        --
        Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
        <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

        Comment

        • Andy Hassall

          #5
          Re: Image storing in database

          On 23 Apr 2005 04:48:01 -0700, "pescott" <google@pescott .com> wrote:
          [color=blue]
          ><?php
          >print ("<table>");[/color]

          All these prints are a bit of a waste of time, when you can output literal
          HTML with PHP easily; just drop out of PHP mode with ?> and put the HTML
          straight in.

          There's nothing actually wrong with all the prints, it's just harder to read
          than it could be.
          [color=blue]
          >print ("<tr>");
          >print ("<td><form method=POST action=xhandlea anbod.php
          >enctype=multip art/form-data>");
          >print ("Omschrijving: ");
          >print ("</td>");
          >print ("<td><input type=text name=form_descr iption1 size=25>");
          >print ("</td>");
          >print ("</tr>");
          >print ("<tr>");
          >print ("<td><input type=hidden name=MAX_FILE_S IZE value=1000000>" );
          >print ("Bestand:") ;
          >print ("</td>");
          >print ("<td><input type=file name=form_data1 size=25>");
          >print ("</td>");
          >print ("</tr>");
          >print ("</table>");
          >?>[/color]

          You've not got a closing form tag or a submit button.
          [color=blue]
          >And handling it, I use 5 of these includes, numbered accordingly
          >
          ><?[/color]

          Short open tags should be avoided, use <?php instead.
          [color=blue]
          >$data1 = addslashes(frea d(fopen($form_d ata1, "r"),
          >filesize($form _data1)));[/color]

          Unfortunately this makes no sense whatsoever.

          $form_data1 will not be set unless you are on a very old version of PHP or are
          running with "register_globa ls" turned on, which is not recommended.

          And anyway, it would not point to an uploaded file. Skipping ahead to the
          error messages:
          [color=blue]
          >Warning: fopen("", "r") - Success in /xhandleaanbod.p hp on line 100[/color]

          First argument is "", which is empty, proving that $form_data1 was not set. So
          it's trying to open an empty file. This produces a weird error ("Success"), but
          it is an error.

          You didn't check for errors when opening the file, so things just get worse
          from here onwards since you're feeding invalid results to the rest of the
          calls.
          [color=blue]
          >Warning: stat failed for (errno=2 - No such file or directory) in
          >/xhandleaanbod.p hp on line 100[/color]

          filesize uses stat to get file information. Since the filename is empty, this
          fails too - there's no file named by the empty string ""/
          [color=blue]
          >Warning: fread(): supplied argument is not a valid File-Handle resource
          >in /xhandleaanbod.p hp on line 100[/color]

          fopen already failed, so passing that file handle to fread is never going to
          work.
          [color=blue]
          >$query = "INSERT into $Tabelnaam &
          >#40;descriptio n1,bin_data1,fi lename1,filesiz e1,filetype1,de scription2,bin_ data2,[/color]

          I'm assuming the &#40; is an artifact of the Google Groups web interface to
          newsgroups which is not very good.
          [color=blue]
          >filename2,file size2,filetype2 ,description3,b in_data3,filena me3,filesize3,f iletyp
          >e3,description 4,bin_data4,fil ename4,filesize 4,filetype4,des cription5,bin_d ata5,f
          >ilename5,files ize5,filetype5) values ('$form_descrip tion1',
          >'$form_data1 ', '$form_data1_na me', '$form_data1_si ze',
          >'$form_data1_t ype', '$form_descript ion2', '$form_data2',
          >'$form_data2_n ame', '$form_data2_si ze', '$form_data2_ty pe',
          >'$form_descrip tion3', '$form_data3', '$form_data3_na me',
          >'$form_data3_s ize', '$form_data3_ty pe', '$form_descript ion4',
          >'$form_data4 ', '$form_data4_na me', '$form_data4_si ze',
          >'$form_data4_t ype', '$form_descript ion5', '$form_data5',
          >'$form_data5_n ame', '$form_data5_si ze', '$form_data5_ty pe')";
          >?>
          >
          >Then I get all these warmings, an entry is made to the database, but
          >the data BLOB fields in there remain empty:[/color]

          You never showed the code that executes a query, just set up an SQL statement,
          so I assume there is more code you haven't posted.

          Read http://uk.php.net/features.file-upload again.

          Note that all access to uploaded files is done through the $_FILES array.

          The following is untested but is closer to what you want:

          <?php
          if (isset($_FILE['form_data1'])
          && $_FILE['form_data1']['error'] == UPLOAD_ERR_OK))
          {
          $data1 = mysql_real_esca pe_string(
          file_get_conten ts($_FILE['form_data1']['tmp_name'])
          );

          // same again for the other files
          // then do your SQL stuff
          }

          There is an example at the bottom of the manual page above that demonstrates
          uploading an array of files, which would be neater than $data1, $data2, ...,
          $data6.

          One slight difference between what you want to do and the full examples in the
          manual is that you don't need to bother using move_uploaded_f ile(), since in
          your case you don't want to keep the file, you just upload its contents to the
          database, then you can leave PHP to delete the temporary file itself.

          --
          Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
          <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

          Comment

          • pescott

            #6
            Re: Image storing in database

            I modified the handling script quite a bit, and there are no parsing
            errors, but still a warning and a db entry error.

            The file description and file itself are browsed in an inclusion
            script, 5, numbered accordingly (corresponding to 5 groups of fields to
            hold data in de db). Then the processing starts, like so:

            <?php
            /* Dit script ontvangt en verwerkt de door "xcheckaanbod.p hp"
            gegenereerde gegevens. */

            // Stel hier de variabelen voor de toegang tot de database in:
            $Host = "localhost" ;
            $Gebruiker = "";
            $Wachtwoord = "";
            $DBNaam = "";
            $Tabelnaam = "aanbod";

            $Verbinding = mysql_connect ($Host, $Gebruiker, $Wachtwoord) or die("Er
            kon geen verbinding worden gemaakt met de database");

            // select database
            mysql_select_db ("$DBNaam");

            // Snijd de binnekomende gegevens bij.
            $adres = trim (htmlspecialcha rs($_POST["adres"]));
            // (Cut the trimming of other fields for space purposes)
            $verkocht = trim (htmlspecialcha rs($_POST["verkocht"]));
            $form_descripti on1 = trim
            (htmlspecialcha rs($_POST["form_descripti on1"]));
            $form_descripti on2 = trim
            (htmlspecialcha rs($_POST["form_descripti on2"]));
            $form_descripti on3 = trim
            (htmlspecialcha rs($_POST["form_descripti on3"]));
            $form_descripti on4 = trim
            (htmlspecialcha rs($_POST["form_descripti on4"]));
            $form_descripti on5 = trim
            (htmlspecialcha rs($_POST["form_descripti on5"]));

            // store the file information to variables for easier access 1
            $tmp_name1 = $_FILES['form_data1']['tmp_name'];
            $type1 = $_FILES['form_data1']['type'];
            $name1 = $_FILES['form_data1']['name'];
            $size1 = $_FILES['form_data1']['size'];

            // store the file information to variables for easier access 2
            $tmp_name2 = $_FILES['form_data2']['tmp_name'];
            $type2 = $_FILES['form_data2']['type'];
            $name2 = $_FILES['form_data2']['name'];
            $size2 = $_FILES['form_data2']['size'];

            // store the file information to variables for easier access 3
            $tmp_name3 = $_FILES['form_data3']['tmp_name'];
            $type3 = $_FILES['form_data3']['type'];
            $name3 = $_FILES['form_data3']['name'];
            $size3 = $_FILES['form_data3']['size'];

            // store the file information to variables for easier access 4
            $tmp_name4 = $_FILES['form_data4']['tmp_name'];
            $type4 = $_FILES['form_data4']['type'];
            $name4 = $_FILES['form_data4']['name'];
            $size4 = $_FILES['form_data4']['size'];

            // store the file information to variables for easier access 5
            $tmp_name5 = $_FILES['form_data5']['tmp_name'];
            $type5 = $_FILES['form_data5']['type'];
            $name5 = $_FILES['form_data5']['name'];
            $size5 = $_FILES['form_data5']['size'];

            // if the upload succeded, the file will exist
            if
            (file_exists('$ tmp_name1','$tm p_name2','$tmp_ name3','$tmp_na me4','$tmp_name 5')){

            // check to make sure that it is an uploaded file and not a system
            file
            if(is_uploaded_ file('$tmp_name 1','$tmp_name2' ,'$tmp_name3',' $tmp_name4','$t mp_name5')){

            // open the file for a binary read
            $file1 = fopen($tmp_name 1,'rb');
            $file2 = fopen($tmp_name 2,'rb');
            $file3 = fopen($tmp_name 3,'rb');
            $file4 = fopen($tmp_name 4,'rb');
            $file5 = fopen($tmp_name 5,'rb');

            // read the file content into a variable
            $data1 = fread($file1,fi lesize($tmp_nam e1));
            $data2 = fread($file2,fi lesize($tmp_nam e2));
            $data3 = fread($file3,fi lesize($tmp_nam e3));
            $data4 = fread($file4,fi lesize($tmp_nam e4));
            $data5 = fread($file5,fi lesize($tmp_nam e5));

            // close the file
            fclose($file1,$ file2,$file3,$f ile4,$file5);

            // now we encode it and split it into acceptable length lines
            $data1 = chunk_split(bas e64_encode($dat a1));
            $data2 = chunk_split(bas e64_encode($dat a2));
            $data3 = chunk_split(bas e64_encode($dat a3));
            $data4 = chunk_split(bas e64_encode($dat a4));
            $data5 = chunk_split(bas e64_encode($dat a5));
            }

            }

            else {
            print("<br><b>N ope! Try again!</b><br>\n");
            }

            $query = "INSERT into $Tabelnaam (adres,verkocht ,
            description1,bi n_data1,filenam e1,filesize1,fi letype1,
            description2,bi n_data2,filenam e2,filesize2,fi letype2,
            description3,bi n_data3,filenam e3,filesize3,fi letype3,
            description4,bi n_data4,filenam e4,filesize4,fi letype4,
            description5,bi n_data5,filenam e5,filesize5,fi letype5)
            values
            ('$adres', '$verkocht',
            '$form_descript ion1', '$data1', '$name1', '$size1', '$type1',
            '$form_descript ion2', '$data2', '$name2', '$size2', '$type2',
            '$form_descript ion3', '$data3', '$name3', '$size3', '$type3',
            '$form_descript ion4', '$data4', '$name4', '$size4', '$type4',
            '$form_descript ion5', '$data5', '$name5', '$size5', '$type5')";
            $Opdracht = mysql_query($qu ery) or die(mysql_error ());

            print ("De opdracht is:<br />$Opdracht<P>\n ");

            if(mysql_affect ed_rows($Verbin ding) == 1)
            {
            print ("De opdracht is met succes uitgevoerd!<br> \n");
            }
            else
            {
            print ("De opdracht kon niet worden uitgevoerd!<br> \n");
            }
            mysql_close ($Verbinding);
            ?>

            The error I get is this:
            Warning: Wrong parameter count for file_exists() in xhandleaanbod.p hp
            on line 91

            Nope! Try again!
            De opdracht is:
            1
            De opdracht is met succes uitgevoerd!

            How do I alter the "parameter count" for these multiple uploads?

            Comment

            • Daniel Tryba

              #7
              Re: Image storing in database

              pescott <google@pescott .com> wrote:[color=blue]
              > I modified the handling script quite a bit, and there are no parsing
              > errors, but still a warning and a db entry error.[/color]
              ....[color=blue]
              > The error I get is this:
              > Warning: Wrong parameter count for file_exists() in xhandleaanbod.p hp
              > on line 91[/color]

              Checks whether a file or directory exists

              and


              will tell you the correct syntax for the parse error you are getting.

              Comment

              • pescott

                #8
                Re: Image storing in database

                I got this, check the filename or directory to see if it exists, but
                how about the syntax for multiple files?

                if (file_exists($t mp_name1)) {

                but for multiple files, do I add an if statement for each filename, or
                can I check to see if they all exist in one go? If I am supposed to
                create if statements for each tmp_name, how fdo I combine these
                statements? Howzitdun?

                if (file_exists($t mp_name1, $tmp_name2)) {

                Comment

                • Andy Hassall

                  #9
                  Re: Image storing in database

                  On 23 Apr 2005 09:42:09 -0700, "pescott" <google@pescott .com> wrote:
                  [color=blue]
                  >I got this, check the filename or directory to see if it exists, but
                  >how about the syntax for multiple files?
                  >
                  >if (file_exists($t mp_name1)) {
                  >
                  >but for multiple files, do I add an if statement for each filename, or
                  >can I check to see if they all exist in one go? If I am supposed to
                  >create if statements for each tmp_name, how fdo I combine these
                  >statements? Howzitdun?
                  >
                  >if (file_exists($t mp_name1, $tmp_name2)) {[/color]

                  if (file_exists($t mp_name1) && file_exists($tm p_name2)) {

                  --
                  Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
                  <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

                  Comment

                  • pescott

                    #10
                    Re: Image storing in database

                    I sure am appreciative of all this help I am getting here, I am on my
                    way, but struggling still. In the db now I have the file description,
                    but nothing else. I have so far::

                    // store the file information to variables for easier access 1
                    $tmp_name1 = $_FILES['form_data1']['tmp_name'];
                    $type1 = $_FILES['form_data1']['type'];
                    $name1 = $_FILES['form_data1']['name'];
                    $size1 = $_FILES['form_data1']['size'];

                    // store the file information to variables for easier access 2
                    $tmp_name2 = $_FILES['form_data2']['tmp_name'];
                    $type2 = $_FILES['form_data2']['type'];
                    $name2 = $_FILES['form_data2']['name'];
                    $size2 = $_FILES['form_data2']['size'];

                    // store the file information to variables for easier access 3
                    $tmp_name3 = $_FILES['form_data3']['tmp_name'];
                    $type3 = $_FILES['form_data3']['type'];
                    $name3 = $_FILES['form_data3']['name'];
                    $size3 = $_FILES['form_data3']['size'];

                    // store the file information to variables for easier access 4
                    $tmp_name4 = $_FILES['form_data4']['tmp_name'];
                    $type4 = $_FILES['form_data4']['type'];
                    $name4 = $_FILES['form_data4']['name'];
                    $size4 = $_FILES['form_data4']['size'];

                    // store the file information to variables for easier access 5
                    $tmp_name5 = $_FILES['form_data5']['tmp_name'];
                    $type5 = $_FILES['form_data5']['type'];
                    $name5 = $_FILES['form_data5']['name'];
                    $size5 = $_FILES['form_data5']['size'];

                    // if the upload succeded, the file will exist
                    if (file_exists($t mp_name1) && file_exists($tm p_name2) &&
                    file_exists($tm p_name3) && file_exists($tm p_name4) &&
                    file_exists($tm p_name5)) {

                    // check to make sure that it is an uploaded file
                    if(is_uploaded_ file($tmp_name1 ) && is_uploaded_fil e($tmp_name2) &&
                    is_uploaded_fil e($tmp_name3) && is_uploaded_fil e($tmp_name4) &&
                    is_uploaded_fil e($tmp_name5)) {

                    // open the file for a binary read
                    $file1 = fopen($tmp_name 1,'rb');
                    $file2 = fopen($tmp_name 2,'rb');
                    $file3 = fopen($tmp_name 3,'rb');
                    $file4 = fopen($tmp_name 4,'rb');
                    $file5 = fopen($tmp_name 5,'rb');

                    // read the file content into a variable
                    $data1 = fread($file1,fi lesize($tmp_nam e1));
                    $data2 = fread($file2,fi lesize($tmp_nam e2));
                    $data3 = fread($file3,fi lesize($tmp_nam e3));
                    $data4 = fread($file4,fi lesize($tmp_nam e4));
                    $data5 = fread($file5,fi lesize($tmp_nam e5));

                    // close the file
                    fclose($file1) && fclose ($file2) && fclose($file3) && fclose
                    ($file4) && fclose ($file5);

                    // now we encode it and split it into acceptable length lines
                    $data1 = chunk_split(bas e64_encode($dat a1));
                    $data2 = chunk_split(bas e64_encode($dat a2));
                    $data3 = chunk_split(bas e64_encode($dat a3));
                    $data4 = chunk_split(bas e64_encode($dat a4));
                    $data5 = chunk_split(bas e64_encode($dat a5));
                    }

                    }

                    else {
                    print("<br><b>N ope, not yet...</b><br>\n");
                    }

                    $query = "INSERT into $Tabelnaam (adres,verkocht ,
                    description1,bi n_data1,filenam e1,filesize1,fi letype1,
                    description2,bi n_data2,filenam e2,filesize2,fi letype2,
                    description3,bi n_data3,filenam e3,filesize3,fi letype3,
                    description4,bi n_data4,filenam e4,filesize4,fi letype4,
                    description5,bi n_data5,filenam e5,filesize5,fi letype5)
                    values
                    ('$adres', '$verkocht',
                    '$form_descript ion1', '$data1', '$name1', '$size1', '$type1',
                    '$form_descript ion2', '$data2', '$name2', '$size2', '$type2',
                    '$form_descript ion3', '$data3', '$name3', '$size3', '$type3',
                    '$form_descript ion4', '$data4', '$name4', '$size4', '$type4',
                    '$form_descript ion5', '$data5', '$name5', '$size5', '$type5')";
                    $Opdracht = mysql_query($qu ery) or die(mysql_error ());

                    print ("De opdracht is:<br />$Opdracht<P>\n ");

                    if(mysql_affect ed_rows($Verbin ding) == 1)
                    {
                    print ("De opdracht is met succes uitgevoerd!<br> \n");
                    }
                    else
                    {
                    print ("De opdracht kon niet worden uitgevoerd!<br> \n");
                    }
                    mysql_close ($Verbinding);

                    And this is the returned error:

                    Nope, not yet...
                    De opdracht is:
                    1
                    De opdracht is met succes uitgevoerd!

                    Comment

                    Working...