Current location: Hot Scripts Forums » Programming Languages » PHP » Database queries or arrays ?


Database queries or arrays ?

Reply
  #1 (permalink)  
Old 03-11-04, 07:26 AM
danux danux is offline
New Member
 
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Database queries or arrays ?

Hi,

I'm working on a small CMS engine using PHP and Sqlite database.
I have a table with 8 fields that holds all the site data.

Is it better to connect to database retrieve all data, put it in a array, and make all changes to that array before you rewrite it in database.
OR every time when you want to update data or add new data query database.


10x for your time !
Reply With Quote
  #2 (permalink)  
Old 03-11-04, 07:46 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
ok got ya ..
I think it doesn't matter ..

if you want to add new data then delete old one or update indivdually/whole ..
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #3 (permalink)  
Old 03-11-04, 07:57 AM
danux danux is offline
New Member
 
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Sorry, my english is not very good !


Is it faster to put all data from databse to an array and make all changes using that array and at the end you update the database(i.e. you call only 2 times SQL when you retrieve data and when you put the new one on) ?
Or every time you want to make any changes you make them directly on the database (i.e. every time you call SQL)

I hope yo'll understand now !

10x for your time !
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Form to update a MySQL database? Scoobler PHP 9 09-04-08 01:41 AM
Share database over the Internet nitinkedia The Lounge 2 11-20-03 02:07 PM
Share database over the internet nitinkedia PHP 0 07-11-03 12:22 AM
Share database over the Internet nitinkedia New Members & Introductions 1 07-10-03 02:50 PM


All times are GMT -5. The time now is 10:19 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.