Images | storing and reading
Posted: Tue Oct 04, 2005 5:00 am
Jcart | Please use
I dont know what is wrong in this code, but nothing happens. You can make upload and there is no error, but there is no real upload to database ( empty database ). He? The uploaded file has cca 10K to max 300K
2.)
If i want to display 10 images ( sorted thru some filter ) how can i make this?
Im making a web page with this infos:
picture1 info link
picture2 info link
picture3 info link
picture4 info link
picture5 info link
picture6 info link
All pictures should be readed from the db. So, you got displayed picture, info, and link to some popup window where you can get more infos about the selected picture. How to make this?
ATH0
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hi !
This is sample script that should do the image upload:Code: Select all
<?php
if ($submit) {
mysql_connect("localhost","x","x");
mysql_select_db("binary_data");
$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')");
$id= mysql_insert_id();
print "<p>This file has the following Database ID: <b>$id</b>";
mysql_close();
} else {
?>
<form method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
File Description:<br>
<input type="text" name="form_description" size="40">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<br>File to upload/store in database:<br>
<input type="file" name="form_data" size="40">
<p><input type="submit" name="submit" value="submit">
</form>
<?php } ?>2.)
If i want to display 10 images ( sorted thru some filter ) how can i make this?
Im making a web page with this infos:
picture1 info link
picture2 info link
picture3 info link
picture4 info link
picture5 info link
picture6 info link
All pictures should be readed from the db. So, you got displayed picture, info, and link to some popup window where you can get more infos about the selected picture. How to make this?
ATH0
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]