CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    Join Date
    Nov 2004
    Location
    Slough, UK
    Posts
    184

    Re: Writing BLOB with ODBC and PHP to Access

    How about: $content="line1\r\nline2" ??
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || ClickOnline ||

    Did I ever say I was an expert?

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Please mark threads resolved by going to the thread tools menu and clicking the Mark Thread Resolved button.

    Has a post really helped you? Please Rate it.

  2. #17
    Join Date
    Jan 2006
    Posts
    13

    Re: Writing BLOB with ODBC and PHP to Access

    I added Pipes:
    $content="line1\r\nline2" ;
    print "<br>|".$content."| ";

    and the Result is:
    |line1 line2|

  3. #18
    Join Date
    Nov 2004
    Location
    Slough, UK
    Posts
    184

    Re: Writing BLOB with ODBC and PHP to Access

    Quote Originally Posted by Player1005
    I added Pipes:
    $content="line1\r\nline2" ;
    print "<br>|".$content."| ";

    and the Result is:
    |line1 line2|
    You need to try these strings in your query, not print them out.

    PHP Code:
    $content "line1\r\nline2"/* custom stirng here */
    fclose($fp);

    if(!
    get_magic_quotes_gpc())
    $fileName addslashes($fileName); }

    print 
    $fileName;
    print 
    $fileSize;
    print 
    $fileType;

    $query "INSERT INTO file (filename, filesize, filetype, filecontent ) VALUES ('$fileName', '$fileSize', '$fileType', '$content')"
    Which ones cause the query to fall over?
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || ClickOnline ||

    Did I ever say I was an expert?

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Please mark threads resolved by going to the thread tools menu and clicking the Mark Thread Resolved button.

    Has a post really helped you? Please Rate it.

  4. #19
    Join Date
    Jan 2006
    Posts
    13

    Re: Writing BLOB with ODBC and PHP to Access

    Now it looks as if the upload would have been succesful.
    But how can I upload a file?
    Last edited by Player1005; January 23rd, 2006 at 01:00 PM.

  5. #20
    Join Date
    Nov 2004
    Location
    Slough, UK
    Posts
    184

    Re: Writing BLOB with ODBC and PHP to Access

    A character in the file is causing the query to fail, this could either be quotes or white space characters. Did you test your query with all those strings? Did any of them cause the query to fail?

    Also, try printing the entier query before you execute it, find the exact location at which it fails and you will have the character which is cuasing the problem.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || ClickOnline ||

    Did I ever say I was an expert?

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Please mark threads resolved by going to the thread tools menu and clicking the Mark Thread Resolved button.

    Has a post really helped you? Please Rate it.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured