[PHP] RE: [PHP-DB] FastTemplates and MySQL data? From: Andrew (andrew <email protected>)
Date: 12/29/00

Hi Jayme,

I'm not sure I understand - do you happen to have an example of using a
variable as a create parameter?

regards,
andrew

> ------ Forwarded Message
> From: "JJeffman" <jjeffmanweb <email protected>>
> Date: Thu, 28 Dec 2000 17:56:24 -0200
> To: <php-db <email protected>>
> Subject: Re: [PHP-DB] FastTemplates and MySQL data?
>
> FastTemplate is not a MySQL neither a PHP function or object. If
> you create
> a php class named FastTemplate which has a php variable as create
> parameter
> you can use it just the way you wrote in your previous message.
>
> Jayme.
>
> http://www.conex.com.br/jjeffman
>
>
>
> -----Mensagem Original-----
> De: Andrew <andrew <email protected>>
> Para: <php-general <email protected>>; <php-db <email protected>>
> Enviada em: quinta-feira, 28 de dezembro de 2000 15:04
> Assunto: [PHP-DB] FastTemplates and MySQL data?
>
>
> > This is a second post, since no one responded the first time... :)
> >
> > Can I somehow pass FastTemplates a MySQL result array, and also
> pass it a
> > template pointer, and get a resultant page? I really just want
> to set up
> a
> > script where a Select parameter is passed in, a result set array is
> > generated, and the array is evaluated against an array of template {}
> > variables. This way I can call pages with essentially one variable.
> >
> > Any ideas?
> > The original post is below.
> >
> > TIA!
> > andrew
> >
> > > Hi,
> > >
> > > <NEWBIE ALERT>
> > >
> > > Can anyone show me an example (or better, point me to some code)
> > > where the FastTemplate class pulls info from MySQL?
> > >
> > > e.g. something like this maybe?:
> > >
> > > <?
> > > $sql = "select * from database where id = id"; file://to get one
> row
> > > $location = "path/to/template/directory"; file://one per
> template set
> > >
> > > mysql_connect($hostname, $user, $password);
> > >
> > > $result = mysql_db_query ("database", $sql);
> > > while ($row = mysql_fetch_assoc ($result))
> > >
> > > {
> > > echo $row["field1"]; file://maybe build dynamically with a
> for loop?
> > > echo $row["field2"];
> > > }
> > >
> > > mysql_free_result ($result);
> > >
> > > $tpl = new FastTemplate($location);
> > > $tpl->define(array ($result, main => main.tpl)); // help!
> > > ?>
> > >
> > > So basically every page (or page section) can be stored as
> one row in a
> > > database and to get your script to generate a different page you just
> have
> > > to pass $sql and $location, since $location defines a set of
> > > templates that
> > > work together to define your page and $sql defines which result
> > > set will get
> > > parsed against the *.tpl in $location
> > >
> > >
> > > I can't believe that this hasn't been done before, but I'm too
> > > green to know
> > > exactly what to do here...
> > >
> >
> > >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-db-unsubscribe <email protected>
> > For additional commands, e-mail: php-db-help <email protected>
> > To contact the list administrators, e-mail: php-list-admin <email protected>
> >
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe <email protected>
> For additional commands, e-mail: php-db-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>
>
>
>
> ------ End of Forwarded Message
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>