SQL in ez..

Author Message

K259

Monday 27 February 2006 5:59:20 am

I have made some sql-selects which retrieves useful content from the ez database. This content is presented today with php outside of ez.

I want to make this content available inside ez. What's the best way of doing this in a template?

Thanks.

Gabriel Ambuehl

Monday 27 February 2006 6:17:42 am

It's probably easiest to create a custom template operator that will use your current PHP script and call that in templates.

Visit http://triligon.org

K259

Thursday 07 September 2006 7:56:28 am

Hi! It's not a script, but a couple of sql's which I want to display inside an ez page. I can create an object of a class, and create an override template for this object(node), but how can I list the results from the sql?

Does anyone have an example-code in ez for this? I guess I have to add a file to kernel/ and then add a template under design/xx... and send the result variable to the designtemplates..and print this with the ez template language..but how?

Norman Leutner

Friday 08 September 2006 12:47:10 am

Take a look at the template operator I made a while ago,
this simply executes a sql command and returns the result to the template:

http://ez.no/community/contribs/template_plugins/topauthors

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 03:38:42
Script start
Timing: Jan 19 2025 03:38:42
Module start 'layout'
Timing: Jan 19 2025 03:38:42
Module start 'content'
Timing: Jan 19 2025 03:38:43
Module end 'content'
Timing: Jan 19 2025 03:38:43
Script end

Main resources:

Total runtime0.7330 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0085 589.0313152.6094
Module start 'layout' 0.00850.0041 741.640639.3984
Module start 'content' 0.01270.7189 781.0391572.6094
Module end 'content' 0.73160.0014 1,353.648412.2031
Script end 0.7330  1,365.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4725160.0002
Check MTime0.00140.1929160.0001
Mysql Total
Database connection0.00170.238510.0017
Mysqli_queries0.680792.8714620.0110
Looping result0.00060.0757600.0000
Template Total0.695594.920.3478
Template load0.00220.299620.0011
Template processing0.693394.588720.3467
Template load and register function0.00020.028010.0002
states
state_id_array0.00100.133610.0010
state_identifier_array0.00100.138620.0005
Override
Cache load0.00180.2466160.0001
Sytem overhead
Fetch class attribute can translate value0.00090.123330.0003
Fetch class attribute name0.00100.133750.0002
XML
Image XML parsing0.00090.126830.0003
class_abstraction
Instantiating content class attribute0.00000.001150.0000
General
dbfile0.00090.1236170.0001
String conversion0.00000.001440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs