This topic is locked

Empty Blob on add

6/16/2006 4:28:12 AM
PHPRunner General questions
J
jenolan author

I have an image field that is a blob in the DB if I do not specify the file name (ie empty) rather than just sending NULL to table I get;
PHP error happened

Technical information

Error type 2

Error description fread(): supplied argument is not a valid stream resource

URL lisa/phprunner/D2_Asset_add.php?

Error file /srv/www/htdocs/phprunner/include/dbcommon.php

Error line 1949

SQL query
Thanks again .. Larry

J
Jane 6/16/2006

Larry,
thank you for pointing me to this bug.

We'll fix it in the next PHPRunner update.
To get your project working open dbcommon.php file in C:\Program Files\PHPRunner\source\include folder, locate and modify myfile_get_contents function in this way:

function myfile_get_contents($filename)

{

if(!file_exists($filename))

return false;


$handle = fopen($filename, "rb");

$contents = fread($handle, filesize($filename));

More...

fclose($handle);

return $contents;

}


Then rebuild your pages.

J
jenolan author 6/16/2006

Then rebuild your pages.


Thanks will give it a go in the morning (well assuming I wake up) have been doing sql DB design for two daze it is more than a man can bear <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=9128&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />
At least my business partner has said I can pay for a full icence now <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=9128&image=2&table=forumreplies' class='bbc_emoticon' alt=':lol:' />