Ad Widget

Collapse

PostrgreSQL solution for images.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rcats
    Junior Member
    • Oct 2007
    • 7

    #1

    PostrgreSQL solution for images.

    The Solution for uploading images with a progress databases is changing the return query of the postgreSQL database in file "includes\images.inc.php":
    In function: function add_image($name,$imagetype,$file)
    else if($DB_TYPE == "POSTGRESQL")
    {
    $image = pg_escape_bytea($image);
    return DBexecute("insert into images (imageid,name,imagetype,image)".
    " values ($imageid,".zbx_dbstr($name).",".$imagetype.",'".$image."')");
    }
    Last edited by rcats; 28-01-2008, 12:09.
  • joggl62
    Junior Member
    • Jan 2008
    • 6

    #2
    syntax error

    Thanks for the solution.
    Now i get the following errors.
    Wath can be the solution for this? any idea? :

    invalid command \221J
    invalid command \376s
    invalid command \221J
    invalid command \376s
    invalid command \'
    invalid command \'
    invalid command \036
    invalid command \275
    invalid command \223
    invalid command \'
    invalid command \221J
    invalid command \376s
    invalid command \003
    invalid command \370$
    invalid command \242
    invalid command \306
    invalid command \274
    invalid command \262i
    invalid command \000
    invalid command \'
    ERROR: syntax error at or near "INSERT"
    LINE 2: INSERT INTO images VALUES (2,1,'Hub (small)','\211PNG\015\01...

    Comment

    Working...