xTxT Documentation

Data Access Examples

Simple Query

A very simple SELECT query.

/tablesql
$conn=server=(local);user id=app;password=app;database=xtxt_demo
select 
	* 
from 
	Website

Controlling Column Names

Column names are pulled directly from the query result set. As such, you can define them as you would like them to appear in the result set.

/tablesql
$conn=server=(local);user id=app;password=app;database=xtxt_demo
select 
	w.Name 'Website Name'
from 
	Website w

Style and Links

Style and linking information, added through the _css, _link, and _target columns.

//connection #test server=(local);user id=test;password=test;database=test
/tablesql
$conn=server=(local);user id=app;password=app;database=xtxt_demo
select 
	case w.Enabled
		when 1 then ''
		when 0 then 'text-decoration: line-through'
		end _css,
	'_blank' _target,
	Url _link,
	w.Name
from
	Website w
order by
	w.Name asc