getting data out of table in the form of array

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
sagrma
Forum Newbie
Posts: 1
Joined: Sat Oct 10, 2009 4:16 am

getting data out of table in the form of array

Post 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
User avatar
akuji36
Forum Contributor
Posts: 190
Joined: Tue Oct 14, 2008 9:53 am
Location: Hartford, Connecticut

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

Post by akuji36 »

Hello

try this link to video tutorial:

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

thanks
rod
http://www.webpagesofease.com
Post Reply