Thread: efficient
View Single Post
Old Jan 25th, 2008, 3:02 PM   #6
kishou
Programmer
 
Join Date: May 2007
Posts: 52
Rep Power: 2 kishou is on a distinguished road
Re: efficient

Quote:
Originally Posted by kruptof View Post
I'll just take a SWAG.

You have two items a picture and a comment and a comment is associated with a picture. You want to be able to retrieve a given picture and its comment.

Have a single table, lets call it TableX, this table will have minimum 2 columns 'Picture' and 'Comment'. When you need to store an image and it's comment just use a INSERT statement or something equivalent to append data to the table and when you want to retrieve something from the table use the SELECT statement or something equivalent.

Note the INSERT and SELECT are sql keywords and note php.
thanks! but would there still be able to be a field like name,email,comment? cause thats what i aiming for. and thx for all of your help so far!
my script is just an insert select. here's an example:
http://pspstuff.elementfx.com/comment.html
kishou is offline   Reply With Quote