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.
Storing 1 field as opposed to an array..
Moderator: General Moderators
- 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..
Do you only want to store the string "img_desc" in $user_desc?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.
“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
Re: Storing 1 field as opposed to an array..
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.