Announcement

Collapse
No announcement yet.

Automatet store a image in database

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Automatet store a image in database

    Hello, I would like to automate using a PHP function to insert a picture stored in SC (project) into a table field (longblob, Image (Database)). I already tried different things with sc_exec_sql with LOAD_FILE (pathtofile), unfortunately without success. Can anyone tell me how this works?

  • #2
    $sql_command = "SELECT my_imgen from my_table WHERE code = ".{CODE};
    sc_lookup(my_data, $sql_command);

    [my_icono] = '<img src="data:image/jpeg;base64,' . base64_encode( {my_data[0][0]} ) . '" width="65" height="65" />';

    Comment


    • #3
      Thanks for the answer, I will test it. What about copying pictures (databased) from table to table?

      Comment


      • #4
        $sql_command = "SELECT CompanyLogo from InstallerProfiles WHERE InstallerProfileID = 1";
        sc_lookup(my_data, $sql_command);

        [my_icono] = '<img src="data:image/jpeg;base64,' . base64_encode( {my_data[0][0]} ) . '" width="65" height="65" />';


        Result the Variable [my_icono not exist]

        OK, i want to realize this in a form with php methode.

        I need 2 PHP Methods in a Form
        1 Copy a picture stored on host to a table field is Image(Database).
        2. Copy a picture from table to table fields are Image(Database)


        In the form i nieed that the user can select an excel Table to import Data in a Database Table

        Comment


        • #5
          ok, i will ask in a other way. I have a stored file anywhere on the host e.g. /tmp/pic.png, and now i will copy this file to a table/field (Image(Database). I need this automate when OneAfterInsert in the form. How can i do this?

          Comment

          Working...
          X