I'm trying to find a way to output whatever BLOB files are inserted into a silly database. In my code when I query the CV column I get all sorts of weird symbols. Can you guys please help me fix my code? $crud->dataview($query); }else{ $query = "SELECT id, from_unixtime(cheie_wp) as datetime, nume, prenume, email, telefon, oras, denumiri_job, cv FROM jobselection_data_old ORDER BY id DESC"; $records_per_page=10; $newquery = $crud->paging($query,$records_per_page); $crud->dataview($newquery); public function dataview($query) { $stmt = $this->db->prepare($query); $stmt->execute(); if($stmt->rowCount()>0) { while($row=$stmt->fetch(PDO::FETCH_ASSOC)) { $date_in = $row['datetime']; $date_out = explode(' ', $date_in); ?> <tr> <td><?php echo $date_out[0]; ?></td> <td><?php print($row['nume']); ?></td> <td><?php print($row['prenume']); …

Member Avatar
Member Avatar
+0 forum 8

I am retriving image from mysql database and want to hyperlink this processed image but not able to find solution for ($i = 0; $i < $rows; $i++) { $description = mysql_fetch_array($result); $img_str= base64_encode($description["nImage"]); echo '<a id="zoom" href="data:image/jpeg;base64,'.$img_str.'"><img src="data:image/jpeg;base64,'.$img_str.'" width="150" height="150" /></a>'; if($i%3 == 2) echo "</br>"; }

Member Avatar
Member Avatar
+0 forum 6

I need help playing audio from mysql blob. I know how to save audio file as blob but I don't know how to play it in vb.net. Is there a way to play audio from mysql blob without saving it first as a file? If so, I need sample codes, thanks.

Member Avatar
Member Avatar
+0 forum 1

Good day! Im developing a client server application that send dataset from the server going to client. I have successfully send my dataset from the server after converting it to xml string. My client had also successfully recieve my xml data from the server. I had also successfully load my xml data to the client dataset. Now the problem is when i try to use the column whith BLOB datatype(originaly from the server) i stuck on with this error. **Unable to cast object of type 'System.String' to type 'System.Byte[]'.** the line that producess this error is as follows: byte[] tempByte; …

Member Avatar
Member Avatar
+0 forum 3

There seems to be a lot of "how to... images in databases" questions. What are the Pros and Cons of this Vs good old fashioned images in folders?

Member Avatar
Member Avatar
+0 forum 2

Hi, Not sure if I should post it here or in DB section. I am extending an application. This application generates a PDF file and stores it in a SQL Server Database table in a column of image datatype. My requirement is to read the data from this column and display it in excel format. Is there any way to do it? I did some research on google and most links point to using a third party class library. Is it possible to do it using VB.NET and SQL Server without using third party class lib (eg: itext). Thanks in …

Member Avatar
Member Avatar
+0 forum 3

Add the snippet in your module. **Requirements:** * Make sure you have reference to M$ ActiveX Data Objects Library (ADODB) * A table field with OLE Object / BLOB as datatype * A recordset that is already oppened and ready to be use **To save Image on your table field, call `SetRSBlob` function** Make sure that your **recordset is already loaded or openned** Lets assume that our recordset `rs` is already oppened and ready to be updated. Dim ret as Boolean ret = SetRSBlob("C:\image1.jpg", rs, "image") TRUE will be returned if image was set to the recordset field. All you …

Member Avatar
+1 forum 0

I have sql database with table Images, in that table there are 2 Columns ID (identity), DisplayImage (image). Table has 2 rows for first row i have written insert into Image values(1,'Libraries\Pictures\Lotus.jpg') and 2nd row as INSERT INTO [dbo].[Image] ([Id],Images) SELECT 2, (select * FROM OPENROWSET(BULK 'C:\Users\Public\Pictures\Sample Pictures\Tulips.jpg', SINGLE_BLOB) AS BLOB) Here is the code for reading the image WebClient instanceHTTP = new WebClient(); Uri MyUri = new Uri("http://localhost:52293/WebSite/ImageHandler.ashx?ImageId=" + TextBox5.Text); //TextBox5.Text for id i.e 1 or 2 Stream returnValue; returnValue = instanceHTTP.OpenRead(MyUri); System.Drawing.Image MyImage = System.Drawing.Image.FromStream(returnValue); // Error if id=1 used i.e normal insert bytearray = imageToByteArray(MyImage); MyImage.Dispose(); if …

Member Avatar
Member Avatar
+0 forum 1

Hello, It is my first time to post here. I have been spending many hours trying to figure out how to get imagedata from my MYSQL database. I have tried these following codes but it wont work for me. view.php <html> <head> </head> <body> </body> <?php include "dbconn.php"; $sql = "SELECT img_id FROM images"; $result = mysql_query($sql) or die("Invalid query: " . mysql_error()); while($row = mysql_fetch_assoc($result)){ echo "Image : ".$row['img_id']; echo "<br/>"; print "<img src='getpicture.php?image_id=$row[img_id]' />"; echo "<br/><hr/>"; } mysql_close(); ?> </html> getpicture.php <?php // connect to the database include "dbconn.php"; if(isset($_GET['image_id']) && is_numeric($_GET['image_id'])) { $id = $_GET['image_id']; $sql = …

Member Avatar
Member Avatar
+0 forum 4

Hi, I am facing OutOfMemory exception in Java, Kindly help me to resolve this issue, really appreciate your help [U][B]ERROR: [/B][/U]java.lang.OutOfMemoryError: Java heap space [B][U]CODE:[/U][/B] [CODE] public Blob getBlob(String databaseInstance, InputStream inputStream) throws SQLException, Exception { applog.info("Entering getBlob"); InputStream stream = null; applog.info("inputStream : " + inputStream); stream = inputStream; applog.info("stream : " + stream); byte[] tmp = new byte[50000000]; byte[] blobValue = null; int sz, len = 0; while ((sz = stream.read(tmp)) != -1) { if (blobValue == null) { len = sz; blobValue = tmp; } else { byte[] narr; int nlen; nlen = len + sz; narr …

Member Avatar
Member Avatar
+0 forum 4

I have a simple jpg image saved in a field of type longblob. Now i need to get that image and put it in a JLabel or something similar to show the picture in the program. Anyone knows how can I do that please? I already know how to get simple text from myql.. just new to pictures. Thanks :)

Member Avatar
Member Avatar
+0 forum 1

How to upload file with oracle database 10gR2?? i can't find how to upload.. i've tried to create a procedure in oracle and execute in netbeans but the file save in directory and then from directory save to database. it means the file save in 2 location, in directory and database.. does anybody know how to save file direct from the JSP file into database without save in directory? this is the procedure.. [code=sql]create or replace PROCEDURE load_file ( p_id number, p_photo_name in varchar2) IS src_file BFILE; dst_file BLOB; lgh_file BINARY_INTEGER; BEGIN src_file := bfilename('DIR_TEMP', p_photo_name); -- insert a NULL …

Member Avatar
+0 forum 0

Hi everyone! My boss is using a Java program called Animal Shelter Manager, which stores all images as BLOBs (Binary Large OBjects) in the database. She needs me to put all of those pictures she has stored on the shelter's website. I look at them in the database, and they are definitely there, but I have a problem getting them out on a complete web page. This script can extract and display an image successfully. [code=php]if( !( $database = mysql_connect( "********", "********", "********") ) ) die( "Bad password."); if ( !mysql_select_db( "asm", $database ) ) die("Could not open animals database"); …

Member Avatar
Member Avatar
+0 forum 1

Hi, I have a successfully working system at the moment where a user can choose a file and upload it to my MYSQL database as a BLOB, but before the image gets saved as a BLOB I want to resize it. I have been giving this a try by using some tutorials but I cannot seem to get it working correctly. I know most people would suggest not saving the image as a BLOB and doing it through file directories but this is not how I want my system to work. Here is my current code: [code=php] <?php header("Location: profile.php?view={$_GET['view']}"); …

Member Avatar
Member Avatar
+0 forum 2

The End.