![]() |
efficient
ok i just finished making my comment script for pictures. but i would have to create a new table each time and now its starting to become very tedious :@. So i was wondering is there a way to make my script more efficient? like mabye only select some rows? or insert into different parts of 1 table? thanks.
|
Re: efficient
For those of us who don't have your project specs, what tables? What pictures? What comments? What are you doing?
|
Re: efficient
Quote:
|
Re: efficient
You might need to post some code. With your current descriptions, the problem at hand is too ambiguous. I doubt anyone could suggest the necessary code to make it more efficient. Post the script?
|
Re: efficient
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. |
Re: efficient
Quote:
my script is just an insert select. here's an example: http://pspstuff.elementfx.com/comment.html |
Re: efficient
I think you want 2 tables, one for pictures and one for comments. Assign each picture an ID, and use that ID to tell what comments correspond to what pictures. Then you can do something like 'SELECT * FROM Comments WHERE PictureId = <picId>' to get all the comments for that picture. Is this close?
|
| All times are GMT -5. The time now is 12:49 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC