hello guys....i am having a problem in inserting image into phpmyadmin database using xampp. I am using longblob while specifying type....but i am not aware ehat to do next...your help would be gleefully accepted...thank you
help in uploading image in phpmyadmin databaseabout xampp
Page 1 of 1
5 Replies - 19112 Views - Last Post: 10 February 2012 - 10:05 AM
Replies To: help in uploading image in phpmyadmin database
#2
Re: help in uploading image in phpmyadmin database
Posted 20 June 2010 - 10:18 AM
First and foremost show us the code you're using to accomplish this.
For the record, it's bad practice to store the actual image in your database. It uses unnecessary resources, and will put an even bigger load on your server every time and image has to be displayed. What you should do is store a link (the path) to the image in your table, then put the actual image in the file system of your site.
For the record, it's bad practice to store the actual image in your database. It uses unnecessary resources, and will put an even bigger load on your server every time and image has to be displayed. What you should do is store a link (the path) to the image in your table, then put the actual image in the file system of your site.
#3
Re: help in uploading image in phpmyadmin database
Posted 20 June 2010 - 10:21 AM
The OP isn't using code. They're using phpMyAdmin to enter data into a table in the database. That's all well and good, but where they're messing up is that they are trying to enter pictures into the database! While that is possible, it is NOT recommended because it will slow the database down. Instead, save the path to the image.
#4
Re: help in uploading image in phpmyadmin database
Posted 20 June 2010 - 05:44 PM
While I agree with PsychoCoder and CTphpnwb about this generally not being the ideal solution, here is how you use phpMyAdmin to add a file to a blob:
Voila!
Some visual-aids, if that wasn't clear enough:
- Select the database you want to use from the left menu bar.
- Select the "Insert" Action on the table your BLOB is in.
- Fill in the form. Use the "Browser" button to select the file for your blob.
- Click "Go".
Voila!
Some visual-aids, if that wasn't clear enough:
#5
Re: help in uploading image in phpmyadmin database
Posted 10 February 2012 - 09:56 AM
Im having problems with actually displaying the files, I have used phpmyadmin for the database, in the products table i have an image field, but i can't figure out how to display the image, i am trying to do it from the filesystem (not with the blob)
$prodsSQL="select prodId, prodName, prodPrice, prodPic
from products
where catId=".$categoryId."
order by prodId";
$execprodsSQL=mysql_query($prodsSQL) or die (mysql_error());
echo "<table>";
echo "<tr>";
echo "</tr>";
while ($prodsarray = mysql_fetch_array($execprodsSQL))
{
echo "<tr>";
echo "<td><a href=proddetailspage.php?prodid=".$prodsarray['prodId'].">";
echo $prodsarray['prodName'];
echo "</td>";
echo "<td>GBP ".$prodsarray['prodPrice']."</td>";
echo "<td>".$prodsarray['prodPic']."</td>";
echo "</tr>";
#6
Re: help in uploading image in phpmyadmin database
Posted 10 February 2012 - 10:05 AM
not to worry I've fixed it
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|