BLHTML.org

BLHTML.org / Web Programming / BLHTML / BLHTML Manual / BLHTML funktion list / BLHTML funktion list / DATA /

 
  where 1433 0
#DATA[variable] post=set where#

where is part of an SQL-question asked along with the SELECT-case:
SELECT field from table where

NOTE! where do not unset the $variable it add the result from the where-case:
$variable = $variable + "outcome from where-case"
it become a BLHTML array and not a normal string!

Example, to first unset $variable then use:
#DATA[variable] post=set where(id = 100) value=NULL#
  • #DATA[variable] post=set value# set value to $variable
  • #DATA[variable] post=set where# get value form field variable from current account
  • #DATA[variable] id=11 post=set where type=fieldlist# create a BLHTML array from data account / table 11
Attributes to #DATA[field] post=set where#:
values     standardvalue       description:
idcurrent accountData account / table where function shall read from
whereSQL where-cast to read one post
blhtmlblhtml=on BLHTML execute where-case
returnreturn=variable stores the results in $variable

Example, retrieve a value from a post in the table:
#DATA[id] post=set value=1# // #$id=1#
#DATA[info] id=10 post=set where(id = #DATA[id]#) blhtml=on#
#DATA[info] id=10 post=set where(id = $id)#
// Simplified is recomended!
// Here the contents include field info, from table 10 where id = 1 to $info

Read field id return the result to $who:
#$buddy=accountame#
#DATA[id] id=2 where(user='$buddy') return=who#


who=#$who#

fieldlist
type=fieldlist make a list from the keyfield from current data account and store the result in a BLHTML array
#DATA[array] post=set type=fieldlist# // $array make a text string from the keyfields
#DATA[array[+]] post=set type=fieldlist# // $array[0] = is the first keyvalue from current data account / table
#DATA[array[*]] post=set field=rubric type=fieldlist#
// $array[key_field_name] = "value" from current data account / table

Attributes for #DATA[variable] post=set where type=fieldlist#:
value     standardvalue       description:
idcurrent accountData account / table where function shall read from
whereSQL where-cast to read many posts
type
fieldkey fieldField where data shall retrieves from
blhtmlblhtml=on BLHTML execute where-case

Example, pick some selected posts from a table:
#DATA[post_pos] post=set value=10# // #$post_pos=10#
#DATA[do] post=set value=10# // #$do=10#
#DATA[name_array]
        id=10 post=set field=name
        where(id >= $post_pos and id <= #SUM value($post_pos $do)#)
blhtml=on
#

// name_array get assigned with name field from data account / table 10 as a BLHTML array
// where id >= 10 and id <= 20

More information:
  • basket
  • #READ#
  • #ECHO#
  • #DATA#
  • MySQL SELECT
  • BLHTML forum  


    apache MySQL PHP No to software patents! BLHTML
    © 2003, 2010 BLHTML
    This page is created with BLHTML in 0.2029 seconds