[htmltmpl] dereferencing issues
Brought to you by:
samtregar
From: Thomas N. <th...@te...> - 2005-08-12 09:10:51
|
Hi I've tried studying perldoc pages, the htmps template pages and most things relating to dbi etc. Despite this I have been unable to understand how to dereference fetchall_arrayref({}) I can dereference fetchall_arrayref() but not fetchall_arrayref ( {} ), i.e the arrayref of hash refs. I would like to query the database using fetchall_arrayref({}), the dereference that and perhaps make changes to some values, put it back into an arrayref({}) and then dump it to html template. SO far I'm stumped with the first part..i simply cant dereference the *fg!?*-thing <grinning> .. anyway, please is there some who can help iterate through arrayref({}) (both key and value). AN example I query the database for "Name", "Adress", "Phone", "Fax", "Email" the $rows = $sth->fetchall_arrayref({}); now i would like to dump my rows into an array and check for certain values etc, for instance lets say the phonenumber is represented as 512445566 in the database, but i want it to display as 512-445566 in the html-template..therefore i would need to access the "Phone" query, check its format, possibly change it, insert the new value in my arrayref of hashrefs. (on my knees and waiting) Thomas |