Hi all,
I have 2 tables in my database. one of them is holding phone number which are GSM,local ect. and minutes of person talk.
for example
49512436544 3.42 min
4924385439 3.50 min
49 is country code:
after 49 : 2 is stands for local and 5 is gsm.
another table is holding prices.
for example
if you called to GSM 4.50 per sec. or local 2.5 per sec. whatever.
I just want to read these number from db. and separate them GSM or local lastly calculate total price and each call's price .
Im new in php. please help me.
I need a help
Moderator: General Moderators
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: I need a help
Are you actually holding the phone duration and the call duration in the same column of the table
Re: I need a help
1.table holds phone number and call duration
2.table holds prices
for example :
first table 49512436544 3.42
second table 0 $ 3.42
as i said before i just wanna read phone number and duration from first table also read price from 2.table this part is easy one
but i have to decide which country called and this is GSM or Local .
i have a lot of country code and each one has different prices.
should i use eregi function or writing query for every countr code ?
phone num. duration (min)
1 5326543312 3:12
2 49512436544 2:43
3 4924385439 0:45
4 552535911385 5:38
5 7258451223 7:20
6 3524124580 2:10
7 5652891 10:54
8 2166613514 6:30
9 66231549608 1:18
10 6654065279 03:25
11 5435113982 04:24
12 5555871105 03:37
Country code GSM ($/sec.) local ($/sec.)
49 1.45 1.10
55 1.75 1.40
72 2.30 1.90
35 1.60 1.20
66 1.25 0.90
after country code
2 stands for local
5 stands for gsm
2.table holds prices
for example :
first table 49512436544 3.42
second table 0 $ 3.42
as i said before i just wanna read phone number and duration from first table also read price from 2.table this part is easy one
but i have to decide which country called and this is GSM or Local .
i have a lot of country code and each one has different prices.
should i use eregi function or writing query for every countr code ?
phone num. duration (min)
1 5326543312 3:12
2 49512436544 2:43
3 4924385439 0:45
4 552535911385 5:38
5 7258451223 7:20
6 3524124580 2:10
7 5652891 10:54
8 2166613514 6:30
9 66231549608 1:18
10 6654065279 03:25
11 5435113982 04:24
12 5555871105 03:37
Country code GSM ($/sec.) local ($/sec.)
49 1.45 1.10
55 1.75 1.40
72 2.30 1.90
35 1.60 1.20
66 1.25 0.90
after country code
2 stands for local
5 stands for gsm
Re: I need a help
Maybe it is easy for the helpers to tell us what database you are using. Every database has it own statements so if we want to help you. Tell us what database you are using.