473,890 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP mySQL - table of images

Not sure is best place to ask, but...
What should the mySQL table look like to save and extract a series of
I want to "insert" an image by name (string) and later "select" and send it
to a web page.


Jul 17 '05 #1
2 1819
the table should be reasonably simple, just 3 columns:

image_id (auto incrementing integer)
image_name (string of pre-determined length)
image_url (absolute or referential, either way this would be a
string... be sure to give it plenty of room though!)

That should be all you need... if you are finding yourself needing yet
more information at a later date, columns are easily added to existing
records. this method should allow you to retrieve the image url by
referring either the image_id or the image_name

Jul 17 '05 #2
I noticed that Message-ID:
<10************ **********@z14g 2000cwz.googleg roups.com> from
ad**@adamcoppin .com contained the following:
image_id (auto incrementing integer)
image_name (string of pre-determined length)
image_url (absolute or referential, either way this would be a
string... be sure to give it plenty of room though!)

That should be all you need... if you are finding yourself needing yet
more information at a later date, columns are easily added to existing
records. this method should allow you to retrieve the image url by
referring either the image_id or the image_name

Short description (useful to automatically add the alt="" attribute) and
long description are useful too.

Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: iwasinnihon | last post by:
I don't usually like to do this, but I need help. I have gone over this code and cannot figure out why it doesn't work. First of all it doesn't check to see if you have filled in the required fields. Second, it doesn't submit the information (it's supposed to send it to mySql and email it to me.) and lastly, it doesn't bring up the thankyou.php after submitting the form. I don't know enough about PHP to find the problem. If someone could...
by: Srdjan Pejic | last post by:
Hello, I have a problem that I have not been able to solve, even after searching the web. I have stored couple of images in the MySQL database and I am trying to get them displayed on a web page with PHP. Now, before we go any further, I want to make it clear that I am very aware of the current debate about storing images in the database. I understand both sides, however this is something I want to do for fun, as well as good learning.
by: Jonas Meurer | last post by:
hello, i develop a project with a mysql interface. one mysql table holds all the images for my project. everything works quite well so far, except i'm not able to upload images into the database. the following function does the mysql UPDATE, it requires the image and the image ID as arguments. additionally it dumps the image to my filesystem ('/tmp/image.gif') -
by: Shaun Campbell | last post by:
I know you're going to say search the mail archives, but I have and I can't find an answer to my simple question of is there an SQL statement to load an image in a .jpg file into a database table? Also, I have read in lots of places that it's probably not a good idea to store images in mysql but just store a pointer to the file. Is this the accepted way of doing things with mysql? Thanks
by: Dejan | last post by:
Hy, Sorry for my terreble english I have this simple code for deleting rows in mysql table... Everything works fine with it. So, what do i wanna do...: my sql table looks something like this: id Name Surname pictr0 picrt1 pictr2 pictr3
by: eholz1 | last post by:
Hello Members, I am setting up a photo website. I have decided to use PHP and MySQL. I can load jpeg files into the table (medium blob, or even longtext) and get the image(s) to display without a problem. I am using chunk_split(data) and the base64_encode and base64_decode on the files. I do a select from the database, and then echo the image (with header(Content Type: image/jpeg) and the decoded image displays fine. Yes, I have...
by: fpcreator2000 | last post by:
Hello everyone. I'm having problems with a page I've created that is used to insert data into a database. It uploads two files into two distinct folder, and it takes the filenames and inserts them into a MYSQL database along with other product information. Here is the entire .php file. I list it because the errors are not showing at all, and I need a fresh pair of eyes to look at it. Any answers, critisims (constructive), or other talk...
by: osward | last post by:
Hello there, I am using phpnuke 8.0 to build my website, knowing little on php programing. I am assembling a module for my member which is basically cut and paste existing code section of various module that I found it useful. Here is the 1st problem I encounter: I had a function to edit a event row form the database which is fine with me, than I pass on the code to a function that save(update) the data to the database.
by: printline | last post by:
Hello All I need a little help with a phph script to display some specific data from a mysql table. I have a mysql table with 4 columns and 10 rows. I want to display fx. data from row 4, 6, 8 and 10. I can display either the first row or all the rows using the below code: $row = mysql_fetch_array($result) or die(mysql_error()); echo $row. " - ". $row. " <img src=images/arlon.jpg /> ". $row. " - ". $row;
by: Keith Hughitt | last post by:
Hi all, I've run into a strange error while trying to store some PNG images in a MySQL database using MySQLdb. When I try to insert smaller images (< 64kb or so) everything seems to work fine. When I start trying to insert larger images (~150kb), however, the images get corrupted along the way. The result is that only part of the image, e.g. the top 30% of the image, is stored in the database, and the rest is simply transparent.
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.