Making a database row an array with a condition

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
mickd
Forum Contributor
Posts: 397
Joined: Tue Jun 21, 2005 9:05 am
Location: Australia

Making a database row an array with a condition

Post by mickd »

hi, im having another slight problem which i cant seem to notice a way to work. any help appriciated :)

i was wondering how you would make a variable from a row in a mysql table like the example below:

Table

Row1, Row2, Row3
name1, lastname1, 1
name2, lastname2, 0
name3, lastname3, 1
name4, lastname4, 1
name5, lastname5, 0
name6, lastname6, 1

is it possible to make an array that goes in array(name1, name3, name4, name6)? where all of them have 1 in row3.

thanks for any replys in advanced!
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

look at mysql_fetch_assoc and mysql_fetch_row
Post Reply