So I have a table that looks like this... CREATE TABLE users ( blah blah blah friends text NOT NULL, blah ); and in `friends` is data like this: '1,868,28,5895,23,239' All of the numbers correspond to another members UID. I'm trying to select just the friends out of the table, so it's efficient and fast. That's easy. One simple query that looks like this: $sel_friends = mysql_query("SELECT friends FROM users WHERE uid='$somevar'")... PHP: But I can't seem to find a way to get that data into one variable that's not an array. So what I want to do, is get a $var to come back so if I print it, I see this: '1,868,28,5895,23,239' Thats it. I can handle everything else. I just can't seem to find a way to get that into a single variable without using loops and all that nonsense. Thanks.
$sel_friends = mysql_query("SELECT friends FROM users WHERE uid='$somevar'"); $var=@mysql_result($sel_friends,0); //Outputs '1,868,28,5895,23,239' echo $var; PHP: EDIT: I know I said mysql_fetch_row would be better/faster, but I doubt you'll see a difference on only one field from one row.