Search found 10 matches

by dilbert
Tue Mar 11, 2003 3:17 am
Forum: Databases
Topic: mysql select question
Replies: 13
Views: 1844

the first line $start_query = "select * from member where refer_by = '$user'"; is not include in the for loop, so it only run once just a example, and I assume everything work fine $user = 'red_dots' then find in the table which refer_by = 'A' , and find that user 'A' 'B' "C' is refer...
by dilbert
Tue Mar 11, 2003 2:59 am
Forum: Databases
Topic: mysql select question
Replies: 13
Views: 1844

oh, sorry, $record_8 should be $record 1. the query is changing since the $start_query is changing every loop 2. I am working on some downline system to count the money of different level. The chart is something like this: http://www.byhk.net/image/test.gif the 'refer_by' of 1 and 2 are A, 'refer_by...
by dilbert
Tue Mar 11, 2003 2:09 am
Forum: Databases
Topic: mysql select question
Replies: 13
Views: 1844

$start_query = "select * from member where refer_by = '$user'"; for ($i = 1; $i <= 6;) { $record=mysql_query($start_query); $content=mysql_fetch_array($record_8); $money += array_sum ($content_8[earning]); // i want $content_8[earning] is a array of all the fields in 'earnings' $sql_info =...
by dilbert
Mon Mar 10, 2003 11:57 pm
Forum: Databases
Topic: mysql select question
Replies: 13
Views: 1844

that means I want to get array of the table of a field, eg, all 'userid' of the whold table of all rows

;)
by dilbert
Mon Mar 10, 2003 5:40 pm
Forum: Databases
Topic: mysql select question
Replies: 13
Views: 1844

I have another question, I want to call the variables from the database as the array mention in above example.I use mysql_fetch_array() but I get error message like below Warning: array_sum() [function.array-sum]: The argument should be an array in /home/dilbert/public_html/fish/shared/global.php on...
by dilbert
Mon Mar 10, 2003 9:49 am
Forum: PHP - Code
Topic: i know it use much resources if you use too many 'for' loop
Replies: 3
Views: 380

if I only getting some data form database and do some simple calculation, does it need much resources?
by dilbert
Mon Mar 10, 2003 9:45 am
Forum: Databases
Topic: mysql select question
Replies: 13
Views: 1844

Thx for your quick reply :D
by dilbert
Mon Mar 10, 2003 9:32 am
Forum: PHP - Code
Topic: i know it use much resources if you use too many 'for' loop
Replies: 3
Views: 380

i know it use much resources if you use too many 'for' loop

but how many loop mean 'too many' , it is too much if I am using it 300(loop 300 times) ?
by dilbert
Mon Mar 10, 2003 9:25 am
Forum: Databases
Topic: mysql select question
Replies: 13
Views: 1844

Sorry for my unclearness :P in the previous post , <= is an arrow in array , say $array , it contain 'A', 'B', and 'C', I know there is something like [select (*) from table where id = 'A' or id = 'B' or id = 'C'], but i don't want to break down my array for using 'for' loop, so I want to select som...
by dilbert
Mon Mar 10, 2003 8:34 am
Forum: Databases
Topic: mysql select question
Replies: 13
Views: 1844

mysql select question

Can I do below in just one line of code?
Let $array be array (A, B, C)

I want use select for below purpose

select (*) form tablw where id=A or B or C <= content in the $array

how can I get that, Thx a lot :D