PDA

View Full Version : Accessing fields in DB


era
04-25-2006, 12:38 AM
Hey folks,

What is the syntax to access a field in the DB? I know how to access cagetgory.DESCRIPTION and db fields like this, but what about a field that isn't accessed yet?

I tried $row['cagetgory.DESCRIPTION'] (for example) and it failed.

Thanks,

Eric

anon
04-25-2006, 02:18 AM
where are you trying to access the database from where?
:?:

(im hoping NOT from smarty)

era
04-25-2006, 03:17 AM
Yes that's the problem. I want to grab row data from a field, and I thought I could simply do it from the TPL file. I guess not.

Eric

anon
04-25-2006, 05:42 AM
Content visible to registered users only.

no, you can, but only from within {php} {/php} tags
then you have to assign the values etc etc.

you're just better off doing it from within the normal .php and assigning it there.

Rob

era
04-25-2006, 06:46 AM
So are you saying I an do this?

{php}$country_name{/php}

If this is the wrong syntax, could you give me a working example?

Thanks much,

Eric

anon
04-25-2006, 07:04 AM
you use real php within the tags and then assign your values for 'outside use' (aka smarty)

I'd like to see some effort in you trying to learn it. If i did it, I'm sure you can too.

Rob