Display Text In Firebird BLOB
I have a Firebird 2.o Database. When I display the text content of a BLOB field, I get the following result.
{
tf1fbidisansiansicpg1252deff0{fonttbl{f0fswissfprq2fcharset0 Helvetica;}{f1fswissfprq2fcharset0 Calibri;}{f2fnil MS Sans Serif;}} {colortbl ;
ed0green0lue128;} viewkind4uc1pardltrparqclang1033f0fs22 DURBANVILLE CONGREGATIONpar DEDICATED 28TH NOVEMBER 1999par.
I use ibase_blob_echo to return a result. How can I get the result to display witout the rtf characters.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
BLOB+PDF : How To Display In Pop-up Window...
I have a table in my db that can store BLOB. Actually the BLOB was came from PDF file that uploaded by the user. How can i retrieve the BLOB file as a PDF file in pop-up windows. I have try another format like .gif and .jpg and it display correctly. But with PDF file it will as me if i want to save the file as postscript.
TEXT Or BLOB Field Problems
When I use a form and php to input long articles (in a TEXT field) into a mysql table, the code runs smoothly (i get a thank you message). However, the record isnt always put into the table. If I input only the varchar fields into the form, then it works. But if I also try to append the TEXT field then it doesn't work from a web form. It works sometimes but not all fo the time. Why does this only work sometimes, do i have to do something witht he code? change the database?
Read And Display Japanese Text From Text File
I posted a question regarding reading japanese text from a text file. Well, since I solved the problem, I thought I'd post my solution for the benefit of other people with the same problem. The plan was to make a script to read and display japanese text. I will use it for making a japanese proverb script and for a japanese language study script. Method : I wrote a simple kanji text file (saved with UTF-8 encoding) I wrote a simple PHP script to display the file contents (saved with UTF-8 encoding) I specified the content-type header for the HTML page : <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> *** All files have the same encoding. *** UTF-8 supports japanese characters. and it works! this is my PHP (and HTML) script : <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>PHP : Japanese Text File Read : Exercise 1</title> </head> <body> <?php $filename="japanese.txt"; //open file $fp = fopen($filename,'r'); //loop through each line in the file while($line=fgets($fp)) { //output current text file line print $line."<br>"; } //close file handle fclose($fp); ?> </body> </html> I know it's a very simple script, for testing purposes only. It displays the contents of the japanese text file line by line. The key was to save all files in the same encoding (I used UTF-8) and to specify the encoding / charset in the HTML header (<meta http-equiv="Content-Type" content="text/html; charset=utf-8">)
Update Mysql Blob With Another Blob Using Php
I have a blob field in a mysql database table. I want to copy a blob from one record to another. I am having trouble transferring the data via a php variable. Maybe I need to addslashes or convert to Hex or something. I've tried a few things but can't quite get it. Here is simplified code. mysql_select_db($dbname, $connection); $query = "SELECT blobthing FROM mytable WHERE id = 1;"; $results = mysql_query ($query, $connection); $row = (mysql_fetch_assoc($result)); $varblobthing = $row['blobthing']; //put the blob in a variable $query = "UPDATE mytable SET blobthing = ".$varblobthing.", WHERE id = 2;"; mysql_query ($query, $connection);
PHP & Firebird On Ubuntu
(I'm running the Ubuntu Breezy Badger OS. I just installed the Firebird Classical Server from the Synaptic Package Manager, I can access my database from another machine with a program I wrote for that purpose or my database manager. I already had Apache2 with PHP5 running. Now I would like to access my firebird database from a PHP script, but as soon as I use ibase_connect() it gives: Fatal error: Call to undefined function ibase_connect() in /extern/webklant/includes/firebird.lib on line 94
Interbase/firebird And Php.ini File
I am looking as some configuration parameters fir Firebird or interbase and the php.ini file. The document has information like ibase.allow_persistent "1" and under a column labeled changeable it has the wording PHP_INI_SYSTEM. Does anyone know what this tag PHP_INI_SYSTEM means and how it is to be specified in the php.ini file? If someone could provide a sample of these types of entries I would really appreciate it.
PHI Interbase Or Firebird Database
I am using the PHP 4.3.4 with a standard (unmodified ) php.ini file. I am tryong to output a blob field that contains a jpeg image using the ibase_blob_echo( row[3]) function. The blob field is the 4th element of my select statement. when I run this through the browser I get "Warning: ibase_blob_echo(): Invalid blob id in /wwwroot/htdocs/hello.php" Has anyone seen this error and what can I do to resolve this?
Create Db Firebird With Php, Exec Does Not Want To Execute A File .bat
I am trying to create db firebird with php, script php generates and executes a file .bat . the file .bat creates db using isql in c:firebirdin, but .bat does not create db when is called by php script, but the file .bat if it works when it is executed from MSDOS, creates db correctly, the question is ¿why the file .bat creates the data base when it is executed by MSDOS but it does not work when is executed by exec in php script? as php script can execute .bat to create db? PHP Code:
Text File Display
I have a number of SQL reports that create standard 132 column text files. The user wishes to view these files in a browser in addition to their daily printing on a laser printer. I can handle directory structure, etc with PHP but I would like to know what is the best way of displaying these text files on screen. We can select them but they are very plain. Is there a TXT2HTML ot TXT2XML type tool that can display headings, bolding, etc without too much difficulty. I would rather not reprogram the reports as there are hundreds of them, and embedding HTML would not be an answer as they need to be printed on a regular laser.
Using PHP To Display News Text
I downloaded a php script from hot scripts called Blue Boy Whats New. I really like what he's done on his site for displaying news items. I got the admin part working and can add and edit news items. I can view the page created bb_news.php3, but when I try to include the php3 file in my home page nothing shows up.
Japanese Text Display
I have Japanese data coming from a mySQL database. It's internal encoding is EUC-JP and it is outputted as SJIS. This actually works just fine. My question comes from the fact that once these changes were made, all the static Japanese text on the page is botched. The meta tag in the head is set to Shift_JIS(SJIS) and it worked before the change. Any suggestions? I just can't see how the two match up... The encoding of the db info shouldn't affect the encoding of static info on the page should it? Especially when they are both output in the same encoding..
Display Html Text From DB
I've got a text box and basically the user types text in html format, I then use htmlspecialchars to convert special characters to HTML entities, fine not a problem I then store the text in a DB with the HTML entities in place. However when I want to display the text from the DB it still has the HTML tags in place and would like to render the HTML so to speak, how do I implement this? Sounds straightforward but need some pointers.
How To Cut Text And Display It Plus The Remaining Texts
just wanna ask if there's a way I can limit the text length i wanna display and display the remaining text below...?? let's say here's my string: $CallNum = $rows['CallNum']; this contains : Q179:1546:554-abc now i want to display this text like this: Q179: 1546: 554- abc
Display A Text File On A Web Page
I have a text file that I am trying to display on a web page. If I cat or more the file it formats and displays fine. When it comes up in the browser it seems to loose tabs and the format gets messed up. This is how I display the file. $show = file("./fields/combined/$cdp$store"); $arrayitems = sizeof($show); $x=0; while ($x < $arrayitems) { print("$show[$x] "); $x++; } If I edit the file it has ^M at the end of each line if it matters. Does anyone have a better idea as to how to display it?
How To Display Text On Browser After Forcing Download
how do i display text to my browser after i force a download? heres my working script: Code: $selected_file = "/home/user/somelogfile.log"; header("Content-Type: text/plain"); header("Content-Disposition: attachment; filename=" . $_SERVER[HTTP_HOST] . "_" . $selected_file); header("Content-length: " . filesize($selected_file)); readfile("$selected_file"); what i want to do is display some text in my browser, but if i echo something after readfile(), it gets included in the download file, while i also cant echo before the download as headers need to be sent before any text .
Display MySQL Data In Text Field
I have my site set up and am now working on the admin side. I have a page that lets me search my users then its linked to another page so I can edit the information. I am attempting to get the code to display in my forms text boxes and text areas for updating. My problem is that I can't figure out how to get the data into my form for editing. I have a few different things but can't seem to figure this out.
Display Results From Text File In Multiple Pages
i use a string, eg "&&&" to mark pages in a text file. i use $count to count the above string. how can i display the contents of this file in multiple pages (by identifying the above string or any other method)?
Identify Url Written In Text Area And Display It Hyperlinked.
I am using html textarea control. user writes text in text area and i save it in database using php, then i display it where ever it is required. I want if user writes some url in the area like www.abc.com or http://www.abc.com , When i display this text as output this url must be shown there as hyperlink. by clicking over it user must be redirected to www.abc .com Is there any html textarea control property that can do it, or i need to write some php or javascript code for it. If someone has php script for it please help. It is urgent.
Display Results From Text File In Multiple Pages
i use a string, eg "&&&" to mark pages in a text file. i use $count to count the above string. how can i display the contents of this file in multiple pages (by identifying the above string or any other method)?
Php And Informix Blob
I am running PHP 4.2.3 with Informix Dynamic Server 2000 Version 9.20.HC. I am trying to insert some text into a blob space and I get a -609 error. here is a code snipit. $textid = ifx_create_blob(0,0,$strText); $blobidarray[] = $textid; $db_query = "insert into assignment_info (user,emp_ext,status,hardware_id,emp_assigned_id,d esc) values('$strEmp_Name','$strEmp_Ext',Ƈ','$strSubCa tegory',Ɔ',?)"; $result = ifx_query($db_query, $connection, $blobidarray); if (!$result) { echo ifx_errormsg(); } else { ifx_free_result($result); } I don't what I am doing wrong. Either the php is bad or my creation of the blob space and the column are bad.
PHP Inside A BLOB?
is this possible at all? would make things a lot more flexible but i don't know if this is parsed at all after getting some html code from a mysql blob.
PHP, Images & Blob Field
I looked everywhere and I have found nothing on the subject of using php to insert an image into a Blob field of a MySQL db, this is possible isnt it?
Storing Image Into BLOB
I am having one problem which is that: - I can upload and store image into BLOB field normally on one machine-winXP where installed Apache 2 and php 4.x - exactly same php code not functioning on the another machine-winXP where running Apache 1.3 and php 4.x What is problem, can I have help from some one? When I check the data stored in BLOB field (by means of saving into Desktop using MySQL Control Center) it were always stored 77 bytes of image/jpeg data, and 66 bytes of image/bmp files!
How To Get A Blob Image Out Of A Record?
Iam posting this after trying many tutorials in the NG and failing to retrieve the blob out of a record. So please bear with me before before you pull the water hose or flame throwers ...... I can upload a Jpeg image file perfectly. Iam using this snippet to do that.. <!-- addpic.php snippet !--> .... $file = fopen($_FILES['pict']['tmp_name'], "rb"); $pic = fread($file, 5000000); // mysql_query(INSERT .... code goes here MySQL Admin shows that the picture I have uploaded 430KB as 428KB, not sure this matters. Now I want to get the image displayed inside my html page <!-- html code goes here ----> <img src="getimg.php?i=8" height=244> <!-- here is the code snippet for getimg.php to extract the blob file --> ($row = mysql_fetch_array($result)) $data = $_GET[$row['pic']]; header("Content-type: image/jpeg"); include $data; // echo $data;
Accessing BLOB From Mysql Db
hi, i m facing a problem in properly accesing BLOBs from mysql db. when i display an image stored in the blob field it show some absurd characters. i think it is the problem of properly telling browser the mime type of image of blob field. that is exactly what my problem is. i do not know how to do that .
Parsing PHP Sourced From Blob
When a php statement is "part" of a markup snippet in a mysql database table field, what must be done to have the php parse in the document. The php tags are being displayed
Read Blob From Mysql
I do have a mysql database with a BLOB column. What is the proprest way to read this column ?
Reading From A Blob Or A File Which Is Better?
I have over 5000 thumbnail pictures of size 5kb each. I would like to able to load all 5000 pictures and view 50 per page using mysql_data_seek(). I would like to know what are the advantages and disadvantages of using a MySQL blob field rather than reading the images directly from the file? How does one insert an image into a blob field? Can it be done dynamically?
Blob Data - Timeout Issue
Hello, I have success when uploading a binary file to a mysql "blob" type when a file is not larger than 2.5MB. When uploading a file >2.5MB, I get an error of MySql server has gone away or cannot allocate file and I get "Couldn't Add File to Database" . I've read the manual on the error, but having checked all the settings i.e. max_allowed_packet=16M, php.ini settings of upload_max_filesize=16M, post_max_size=16M, max_execution_time=3600 and also httpd.conf timeout= 3600 and the error still persists. Is it mysql, php, apache or the script? HTML: <form enctype="multipart/form-data" name="frmUploadFile" action="grabfile.php" method="post"> <INPUT TYPE="hidden" NAME="MAX_FILE_SIZE" VALUE="16000000"> The script: grabfile.php <? $dbServer = "localhost"; $dbDatabase = ""; $dbUser = ""; $dbPass = ""; $fileHandle = fopen($fileUpload, "r"); $fileContent = fread($fileHandle, $fileUpload_size); $fileContent = addslashes($fileContent); $sConn = mysql_connect($dbServer, $dbUser, $dbPass) or die("Couldn't connect to database server"); $dConn = mysql_select_db($dbDatabase, $sConn) or die("Couldn't connect to database $dbDatabase"); $dbQuery = "INSERT INTO myBlobs VALUES "; $dbQuery .= "(0, '$strDesc', '$fileContent', '$fileUpload_type')"; mysql_query($dbQuery) or die("Couldn't add file to database"); echo "<h4>Upload of $fileUpload_name is complete.</h4>"; echo "The details of the uploaded file are shown below:<br><br>"; echo "<b>File name:</b> $fileUpload_name <br>"; echo "<b>File type:</b> $fileUpload_type <br>"; echo "<b>File size:</b> $fileUpload_size <br>"; ?> Any suggestions?
Dynamic Menus And Blob Problems
I have a database table with three fields, id, caption and data. I have used the id and caption to create a dynamic menu. it just throws it into a loop with extra html formatting stuff. No problem. The data field is a large blob. The data is a complete html file which comes out of a timing system for race cars, its basically a big table. How do I render the blob data within the current window or in a new window when the link is clicked, its got me stumped. I have used php to bring the page together using include statements, header footer and side_nav. the menu gets produced in side_nav.
Dynamic Menus And Blob Problems
I have a database table with three fields, id, caption and data. I have used the id and caption to create a dynamic menu. it just throws it into a loop with extra html formatting stuff. No problem. The data field is a large blob. The data is a complete html file which comes out of a timing system for race cars, its basically a big table. How do I render the blob data within the current window or in a new window when the link is clicked, its got me stumped. I have used php to bring the page together using include statements, header footer and side_nav. the menu gets produced in side_nav.
BLOB Data As Src For Thumbnail Creation?
I have images stored on my MySql database as Binary "BLOB" filetypes. I want to make thumbnails of these files to display. I know how to create thumbnails using paths and image names of .jpg files. But I do not know how to use Binary"BLOB" image data to create them. Do I have to encode the data in a certain format for the getimagesize(), ImageCreateFromjpeg() and imagejpeg() functions to work? Or does this have something to do with specifying a MIME type? I don't know how to get the functions to read the BLOBs.
Iterating Through Tables With Blob Parts
I'm probably crazy for even trying this but I'm trying to make a script that will iterate through my databases, iterate through all the tables, and show everything on one page in forms that allow me to change the data when I hit the submit button. Blogs are displayed as links to image.php?id=$id along with browse buttons so new images can be uploaded. The idea is to make an idiot proof way for artists to change their web databases without having to use phpadmin. Its not that hard when all the tables have ids that are the same. I simply find the highest id from the first table, then iterate through the ids and call each table for every id. $sql="select * from $table where id=$id"; Some of these art graphics are quite large, so I wanted to break them up for easier downloading. The trouble started when I broke the blobs up into 64k parts and gave each blob a master id. for example: imagemeta image id=1 id=1 masterid=1 id=2 masterid=1 id=3 masterid=1 id=2 id=4 masterid=2 id=5 masterid=2 This is how it was done at However, it seems kind of crazy to me because the image ids have nothing to do with the imagemeta ids; I can't just iterate through the ids and assume that all the data in each id corresponds to data in other tables with the same id. So I tried it like this: imagemeta image id=1 id=1 part=1 id=1 part=2 id=1 part=3 id=2 id=2 part=4 id=2 part=4 This seems crazy too, because you end up with multiple ids with the same number in the image table. Either way, it gets pretty complicated. Is there any preferred, definitive way this should be done ? Right now I'm working on doing it the first way (above). But here's the complicate way I have to do it: first,I iterate through the masterids in the first image table, learn which ids it holds and then iterate through the other tables while checking to see if each table has a master id. If it does, I use the master id to call up the image. if it doesn't I use the ids I found in the first table to call up the metadata.
Insert And Select Images (BLOB) From DB2 Using PHP?
DOes anybody have a working example of how do make this work? I've tried everything I could find, Clara patch, many non-working examples using pack, baseencode, addslashes, str_replace, bin2hex, hex2bin, for read only, using different db2 dataypes blob,clob etc.....I'd post code but I've tried too many to list. just an example would be excellent. I've been trying 2 days now. I know there is a php bug report 25118 http://bugs.php.net/bug.php?id=25118 If I use the DB2 datatype of clob, I can get the insert to work (at least not produce errors), but getting anything useful back out is pointless. It seems I can only retrieve 4k of crap (or mabey the insert only put 4k there). I can read the thing back to a file and look at it, the first 4k of stuff matches what I input (in this case a 26k jpeg file), but after that it looks just like random crap including some php code (pretty funny), so it appears to be padding the file to the proper length with junk. datatype of blob produces error on the insert no matter what I try Any working examples out there? Please please...I really could use some sleep. PS, storing on filesystem and putting pointers in DB is not an option in this case.
How Do I Get Image Data Into A Blob Field
I am trying to get image data into a mysql field (like a simple jpg). Does anyone have a quick tips on how to submit an image (through an html form) process via php and insert into a mysql blob field?
Write A File From MySQL BLOB
I am storing a BLOB in a MySQL database, and want to know how to write it out again to a file on the server, in a specified location, in php.
Mysql BLOB Image Resize
Having a small nightmare trying to resize an image that is stored in a blob. Anyone had any experience with this? I can find is some vague reference to image magic pulling an image from a blob, but that's about it. I DON'T want to have to create a file though to display an image, just pull it from the DB and display it via PHP which is what it currently does.
Apostrophe Or Single Quote In A Blob
i use an apostrophe or single quote in a blob and it returns an error. any message without the apostrophe passes on smooth. is there some escape character or something i need to use for this one?
PhpMyAdmin InnoDB Insert Into BLOB?
Anyone ever used InnoDB storage engine and try to insert into BLOB fields with phpMyAdmin. For some reason it won't do it, due to some guess at a row count?
Determining Mime Type Of MySQL Blob?
Is there any PHP function that will allow me to determine the MIME type of a blob stored in MySQL? Specifically, if I'm storing an image as a blob in MySQL, is there any PHP function that can determine whether it's a gif, jpeg, png, etc?
Word Doc Stored As BLOB In MySQL - Retrieval ?
I've stored a word doc as a LONGBLOB in MySQL. To retrieve the contents of the file, I have a script which creates a temporary file, writes the contents to the file, then auto-redirects the browser to the .doc file; the browser then prompts the user to download the file. The original .doc, which was uploaded to MySQL and the .doc downloaded from the temp file are the exact same size. However, MS Word won't open the downloaded .doc file, saying that "The document name or path is not valid" Anyone else run into this problem getting Word docs from MySQL?
Resizing Uploaded Images Before Inserting As BLOB
I have a system that uploads images as BLOBs in a database. I also have a function that I use to resize uploaded images before saving as files. I would like to combine these two by resising the images before inserting them as BLOBs. My problem is that (apart from being new to file stuff) my resize function returns a Resource ID which of course is not the same as the file handler that was passed to it, it's a reference to an image created with imagecreate(). The resize function usually uses imagejpeg() for the final step of creating the file, is there something similar I need to use to return a file reference for inserting into the database? This is the bit that inserts the resized image into the database.. $thisImage = createImageFromSource($fm_image,"",$imgWidth,$imgHeight,"low"); if($thisImage){ $imageData = addslashes(fread(fopen($thisImage, "r"), filesize($thisImage))); doQuery("INSERT into productImages(fileData,fileSize,fileType,productID ) VALUES('".$imageData."','".$thisImage_size."','".$thisImage_type."','".$fm_productID."');"); } As you can see, I need createImageFromSource() to return a file handler into $thisImage that can be used by the fread and fopen functions. At present createImageFromSource does this (GD 1.6.2): $src = imagecreatefromjpeg($source); $dst = imagecreate($tn_width,$tn_height); imagecopyresized($dst, $src, 0,0,0,0, $tn_width, $tn_height, $width, $height); if($destination!=""){ imagejpeg($dst, $destination, -1); }else{ return $dst; }
Mcrypt Blob Upload Problem To MySQL
I have a script in which I am collecting sensitive information via a form (METHOD=POST) and encrypting the posted variable (format = BLOB) using mcrypt, then saving it in a MySql table. Using my test script,everything works fine. Using my production scrypt, everything works fine for data posted with fewer than 8 characters. If I try to upload data longer than 8 characters, I get this error message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ióU¹ ”šC!ÊŒB', ༽', ��', NULL, 飮')' at line 1 The characters ióU¹”šC!ÊŒB' after "near" are the encrypted characters. There does not seem to be any difference between the test and production scrypts. Here is the syntax I am using for saving the record: if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "myTable")) { $insertSQL = sprintf("INSERT INTO myTable (`Date`, LastName, FirstName, EcryptedBlob) VALUES (%s, %s, %s, %s)", GetSQLValueString($_POST['Date'], "text"), GetSQLValueString($_POST['Lastname'], "text"), GetSQLValueString($_POST['Firstname'], "text"), GetSQLValueString($encrypted,"text")); php v. 5.0.5 MySql v. 4.1.9
|