BloodyBeginner Posted June 7, 2008 Share Posted June 7, 2008 Hello! I am rather new here, so please be patient I have found a script on the internet that allows to upload text and images to table of a database and to output single images from the same table. He script consists of two files, one for the upload and one for the download/output. The one for the upload is working very well. I manage to upload one image at a time in combination with a description, title etc. successfully into the table of the DB and can see it there. So far so good. The output with “getdata.php” is more tricky. Whatever I do, I only manage to output one single image in its original size at a time. I have tried to resize it, to place it into a table and to present text from the database in combination with the image but do not succeed. I can on the other hand present text only from the database without the image. But not both at the same time. After quite a few hours without success, I am now asking you for help. My problems that I like to solve are: 1) How can I resize the image and present it in a table? 2) How can I at the same time and in the same table present text from the database (title, description etc) in combination with the image. Any help is very appreciated. I include the “getdata.php” and the table “binary_data” below. Thank you very much and kind regards from Sweden! /Felix ------------------------- getdata.php ------------------------- <?php // getdata.php3 - by Florian Dittmer // Example php script to demonstrate the direct passing of binary data // to the user. // Syntax: getdata.php3?id=<id> if($id) { include("../include/datalogin.php"); @mysql_select_db("binary_data"); $query = "select bin_data,filetype from binary_data where id=$id"; $result = @MYSQL_QUERY($query); $data = @MYSQL_RESULT($result,0,"bin_data"); $type = @MYSQL_RESULT($result,0,"filetype"); Header( "Content-type: $type"); echo "$data"; }; ?> ----------------------------- The table “binary_data”: ------------------------- CREATE TABLE `binary_data` ( `id` int(4) NOT NULL auto_increment, `myid` varchar(5) default NULL, `name` varchar(50) default NULL, `data1` text, `data2` text, `data3` text, `description` varchar(100) default NULL, `bin_data` longblob, `filename` varchar(50) default NULL, `filesize` varchar(50) default NULL, `filetype` varchar(50) default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ; ----------------------------------- Link to comment https://forums.phpfreaks.com/topic/109120-trouble-to-output-and-resize-both-and-text-and-image-from-database/ Share on other sites More sharing options...
BloodyBeginner Posted June 7, 2008 Author Share Posted June 7, 2008 Hello again! Problem solved (for now). Thank you all who gave my problem a thought. Best wishes /Felix Link to comment https://forums.phpfreaks.com/topic/109120-trouble-to-output-and-resize-both-and-text-and-image-from-database/#findComment-559898 Share on other sites More sharing options...
DarkWater Posted June 7, 2008 Share Posted June 7, 2008 Glad you could fix your problem. Just out of curiosity, what did you do to fix it? Link to comment https://forums.phpfreaks.com/topic/109120-trouble-to-output-and-resize-both-and-text-and-image-from-database/#findComment-559899 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.