View Single Post
Old 10-11-2007, 05:35 PM  
RedShoe
赤い靴 call me 202-456-1111
 
RedShoe's Avatar
 
Industry Role:
Join Date: Feb 2001
Location: The Valley
Posts: 14,831
Quote:
Originally Posted by Varius View Post
You really shouldn't be mixing php code into your smarty templates as the whole purpose of smarty is to separate code from html.

However Smarty has no mysql functions I know of, so to do it in the template you would have to use {php}{/php} to allow you to execte php code and then use php's mysql functions like mysql_connect(), mysql_db_query(), etc...

I recommend since you are starting though to start the right way and use adoDB or another db abstraction layer class to keep things portable and clean.

Do your SQL in the php file and assign it to whatever variables you need to access it with in smarty. Don't tdo your SQL in the template.
I guess, that's the part that boggles my mind.
Smarty prides itself on not needing mysql, and doesn't even offer a way to use mysql... so then how do you use databases? Can you even use databases?

I want to create database of all our girls, and display them with Smarty and be able to sort them, and rate them, all that (in time). And I'm willing to kinda play with it and learn it myself, but I just don't see how you do that WITHOUT the use of mysql.
__________________

SPECIALTY COSTUMES • PROPS • FX
Superheroes • Monsters • Robots
PM for details


For any manufacturing needs. Adult or otherwise.

aka BonsHigh on Insta
Bonsai weed plants


RedShoe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote