I have JPGs as binary stuffed into a mysql database. I've written a www/php front-end DBA utility that queries tables, and returns user-specified results in a pretty html table. However, binary JPGs are huge (+3 MBs sometimes), and instead of rendering a bunch of useless binary data (sending 3MBs of text to the client's browser), I'd like to be able to run a condition like:
$sql='select * from tbl_name return first 256 characters';
I know that's not a real query - but there's got to be a way to get mysql only return the first ### (some arbitrary number that the user can specify) characters of a result, for each field, in eac row returned.
Any ideas?
Ideally, if i could do something like test for a returned result > 256 characters, and render a link like:
<a href='page.php?show_all=true'>Data larger than 256 Characters - Click Here to view entire contents</a>
...instead of doing a strlen<### in php would be just neato; ie., i'd like to avoid making my server/php run the check, and just have mysql return 256 characters TO PHP. Or something...
TIA,
-Paul.