Storing 1 field as opposed to an array..

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
orbdrums
Forum Commoner
Posts: 82
Joined: Wed Sep 14, 2011 11:42 pm

Storing 1 field as opposed to an array..

Post by orbdrums »

I have the following code that stores an array to a variable:
$user_desc = $row4'[img_desc'];
How would I just store "img_desc" from the current record in a while loop? Would it be:
$user_desc = $row4'img_desc';
Thanks in advance for any help.
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Storing 1 field as opposed to an array..

Post by social_experiment »

orbdrums wrote:I have the following code that stores an array to a variable:
$user_desc = $row4'[img_desc'];
How would I just store "img_desc" from the current record in a while loop? Would it be:
$user_desc = $row4'img_desc';
Thanks in advance for any help.
Do you only want to store the string "img_desc" in $user_desc?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
orbdrums
Forum Commoner
Posts: 82
Joined: Wed Sep 14, 2011 11:42 pm

Re: Storing 1 field as opposed to an array..

Post by orbdrums »

Yes. I only want to store 1 record's field from an array. So $row4['img_desc'] may have more than 1 result but I want to create a variable that contains only 1 result depending on a condition.
Post Reply