Page 1 of 1

getting data out of table in the form of array

Posted: Sat Oct 10, 2009 4:23 am
by sagrma
hi,
see i want to get data from table in the form of array
am doing it for a mod of aef forum

what i have done is

declared a variable $user_who_thanked as array in a file post.php

now i am trying to get the values out via

Code: Select all

//Who thanked this topic
    if(!empty($globals['who_thanked_topic'])){
    
        
        $qresult = makequery("SELECT DISTINCT u.id, u.username, ug.mem_gr_colour
                    FROM ".$dbtables['thanked_topics']." tt
                    LEFT JOIN ".$dbtables['users']." u ON (tt.tt_uid = u.id)
                    LEFT JOIN ".$dbtables['user_groups']." ug ON (u.u_member_group = 
                                                                ug.member_group)
                    WHERE tt.tt_tid = '$tid'
                    ORDER BY u.id ASC");
                    
        for($i = 1; $i <= mysql_num_rows($qresult); $i++){
            
            $row = mysql_fetch_assoc($qresult);
            
            $users_who_thanked[$row['id']] = $row;
            
        }
    
    }

but i cant

and ['who_thanked_topic'] isn't causing the problem
please help

Re: getting data out of table in the form of array

Posted: Thu Oct 15, 2009 11:32 am
by akuji36
Hello

try this link to video tutorial:

http://www.learningnerd.com/phpmysql-day-5

thanks
rod
http://www.webpagesofease.com