Current location: Hot Scripts Forums » Programming Languages » PHP » Bandwidth vs Query


Bandwidth vs Query

Reply
  #1 (permalink)  
Old 01-23-06, 09:02 AM
Jope Jope is offline
Newbie Coder
 
Join Date: Dec 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Bandwidth vs Query

Is it better to store all data to one row or to store id's and query select later?

example

$name = "john";
$surname = "doe";
$status = "2"; // 2 is id for employee
now i need to get payment of employees
so i query
select `status` where 'id' = "2"
and get that payment

is it better to make this
$name = "john";
$surname = "doe";
$status = "employee-4000$";
and then
explode("-", $status) ?

i could remember only this example
in fact there are alot more datas like this and they are stored in more
than 3 tables.. so i think its stupid to query all time

there would be about 300 rows like this..

tnx
__________________
www.mikromin.com
www.besplatne-igre.com
Reply With Quote
  #2 (permalink)  
Old 01-23-06, 09:06 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
I prefere the first method, give you plenty of room for change..
you can use joins to merge the 2 SELECTs in one query..
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #3 (permalink)  
Old 01-23-06, 09:30 AM
Jope Jope is offline
Newbie Coder
 
Join Date: Dec 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by NeverMind
I prefere the first method, give you plenty of room for change..
you can use joins to merge the 2 SELECTs in one query..
So it is better to query 3 tables than about 100-200 characters more per row?
__________________
www.mikromin.com
www.besplatne-igre.com
Reply With Quote
  #4 (permalink)  
Old 01-23-06, 02:11 PM
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
I thought they were only a couple of tables..
even tho, IMHO Joins are the way to go..
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]

Last edited by NeverMind; 01-24-06 at 05:04 AM.
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
code problem throws error matt001 ASP.NET 0 10-23-05 03:30 AM
500MB/5GB Bandwidth with our Starter $3.95/mo Plan - cPanel/Fantastico/RVSkin +more! WireNine.com General Advertisements 0 07-12-05 05:30 PM
Nested Query in PHP/MYSQL truesilentassassin PHP 2 07-27-04 07:50 PM
Declared Functions skipper23 PHP 4 12-17-03 10:06 AM
index page not showing up skipper23 PHP 3 12-15-03 01:10 PM


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