We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

php array help

3xtr3m3d
3xtr3m3d asked
on
Medium Priority
264 Views
Last Modified: 2012-05-11
Hi

$tblcategory = 'cat_code,cat_description,user,stamp,ip';  //table field order
$expectedFields = 'id,cat_description'; //form fields

$tblorder = explode(',', $tblcategory);
$expectedorder = explode(',', $expectedFields);

im reading values like below

foreach ($tblorder as $data){            
            $result[$data]= $_GET[$data];      
}

im getting primary key always as id and but primary key of this table is cat_code

so how to read id value as cat_code and assign that to result array?


hope someone will understand what i meant

Thanks



Comment
Watch Question

Top Expert 2011
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
Thanks a lot.

also is there way to skip a value from reading?
Top Expert 2011
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.