Re: idiot problem with mysql/php
| From: | Brian Rak | Date: | Fri, 28 Jul 2000 01:47:22 +0000 |
| Subject: | Re: idiot problem with mysql/php | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-1357@lists.php.net to get a copy of this message | ||
Andres,
My approach to storing images in a MySQL database is to actually store
string *references* to them. I just put all the images in a folder somewhere
on the hard drive, and then put strings like "C:\images\myimage.gif" into
the MySQL DB. Try it out, it works great!
Brian
"Andres Baravalle" <andres@baravalle.co.uk> wrote in message
news:4.3.1.2.20000722184208.00b34808@baravalle.co.uk...
Hi,
I have to put (and get) some images from a database in mysql. Evrithing
works fine in my internet database, but not in my local machine (I run a
iis server, php, mysql).
The images are not stored well in the database (the table is identical to
the table I have in my internet mysql database).
That's the code I used to store the images:
MYSQL_CONNECT( "localhost", "****", "****");
mysql_select_db( "*****");
$data = addslashes(fread(fopen($form_data, "r"),
filesize($form_data)));
$result=MYSQL_QUERY( "INSERT INTO binary_data
(description,bin_data,filename,filesize,filetype) ".
"VALUES
('$form_description','$data','$form_data_name','$form_data_size','$form_data
_type')");
MYSQL_CLOSE();
Any ideas?
Thanks in advance,
Andres Baravalle
By the way: I have some cookies that are not read in my local computer, but
are read in my web site. Any suggestion? If I connect to internet, work
well even in the local copy of my web site.
____________
Andres Baravalle
mailto:andres@baravalle.co.uk
http://www.baravalle.co.uk
tel: +39 015 20511
cell: +39 0328 6754092
fax: +39 02 700431996
____________
I direttori passano, i ficus restano. Quale
carriera è più felice, più vicina ai vertici
aziendali e nel contempo priva di rischi e
responsabilità?
' Voglio essere un ficus' disse il mánagero con
gli occhi lucidi.
Stefano Benni
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
For additional commands, e-mail: php-windows-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net