How can I insert blob data into my database through SQL alone. I have a set of functions I can use in php to do it, but without php, delphi, java and only useing SQL how can I do this.

I read in a responce to someones post on anothe forum, you can use parameters:

insert into mytable
(column1, blob)
values (4, :blobparam);

then all they said was prepair that statement, then set the param. But how?

I cant find any examples on this, other then useing java, delphi or simular.

Can someone please direct me to an example or more information.

    If you want to insert an image, try this

    <?php
    $db_name = "whatever";
    $table_name = "whatever"; // Your table Name
    $field_name = "image";
    $filename = "kart.gif"; // Put here your file
    
    $fd = fopen ($filename, "r");
    $contents = fread ($fd, filesize ($filename)); //Read de contents of the file
    fclose ($fd); 
    
    $contents = addslashes($contents); //Scape characters
    
    $conex = mysql_connect("localhost", "root", "");
    mysql_select_db($db_name, $conex);
    $sSql = "insert into " . $table_name . "(" . $field_name . ") values ('" . $contents . "')";
    
    $result = mysql_query($sSql, $conex);
    echo mysql_errno(), ": ", mysql_error();
    ?>
    
      Write a Reply...