Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, October 14, 2026

Diff for phpMyEdit/doc/sgml/configuration.fields.sgml between version 1.35 and 1.36

version 1.35, 2003/12/15 14:32:22 version 1.36, 2003/12/18 20:36:01
Line 1 
Line 1 
 <!-- $Platon: phpMyEdit/doc/sgml/configuration.fields.sgml,v 1.34 2003/12/11 12:29:47 nepto Exp $ -->  <!-- $Platon: phpMyEdit/doc/sgml/configuration.fields.sgml,v 1.35 2003/12/15 14:32:22 nepto Exp $ -->
   
 <!-- Categories:  <!-- Categories:
   
Line 777  $opts['fdd']['title']['sql'] = 'IF(TRIM(
Line 777  $opts['fdd']['title']['sql'] = 'IF(TRIM(
 </para>  </para>
 <para>  <para>
   
 First example appends content of <varname>firstname</> field to  The first example appends content of the <varname>firstname</> field to the
 <varname>surname</> field. Because this is done on the database level, sorting  <varname>surname</> field. Because this is done on the database level, sorting
 and searching (in table filtering page) on this field will properly work.  and searching (in table filtering page) on this field will properly work.
 Similarly in the second example, the <varname>title2</> field will be used if  Similarly in the second example, the <varname>title2</> field will be used if
 <varname>title</> field is empty. In this manner you can define some special  the <varname>title</> field is empty. In this manner you can define a special
 static string, which should be printed in case a field is empty. Just  static string, which should be printed in case a field is empty. Just
 substitute a quoted string in place of <varname>title2</>.  substitute a quoted string in place of <varname>title2</>.
   
Line 802  $opts['fdd']['title']['sqlw'] = 'TRIM("$
Line 802  $opts['fdd']['title']['sqlw'] = 'TRIM("$
   
 The first example above makes <varname>surname</> uppercase when storing field  The first example above makes <varname>surname</> uppercase when storing field
 into database. The second one trims all whitespace characters around  into database. The second one trims all whitespace characters around
 <varname>title</> before writting it to database.  <varname>title</> before writing it to database.
   
 </para>  </para>
 <para>  <para>
Line 813  As a placeholder for the field's content
Line 813  As a placeholder for the field's content
 <member> &nbsp; <varname>$val</varname></member>  <member> &nbsp; <varname>$val</varname></member>
 <member> -- value of the field</member>  <member> -- value of the field</member>
 <member> &nbsp; <varname>$val_as</varname></member>  <member> &nbsp; <varname>$val_as</varname></member>
 <member> -- value with applied <function>addslashes()</function> function</member>  <member> -- value with <function>addslashes()</function> function applied</member>
 <member> &nbsp; <varname>$val_qas</varname></member>  <member> &nbsp; <varname>$val_qas</varname></member>
 <member> -- same as <varname>$val_as</varname> with quotes around</member>  <member> -- same as <varname>$val_as</varname> with quotes around</member>
 </simplelist>  </simplelist>
Line 821  As a placeholder for the field's content
Line 821  As a placeholder for the field's content
 </para>  </para>
 <para>  <para>
   
 So if the <varname>$val</varname> is <constant>some"nice"thing</constant>,  If the <varname>$val</varname> is <constant>some"nice"thing</constant>, then
 than <varname>$val_as</varname> becomes <constant>some\"nice\"thing</constant>  <varname>$val_as</varname> becomes <constant>some\"nice\"thing</constant> and
 and <varname>$val_qas</varname> becomes  <varname>$val_qas</varname> becomes <constant>"some\"nice\"thing"</constant>.
 <constant>"some\"nice\"thing"</constant>. You have to use these variables  You have to use these variables correctly in your <varname>['sqlw']</varname>
 correctly in your <varname>['sqlw']</varname> expressions, otherwise MySQL  expressions, otherwise a MySQL parsing error could occur. We recommend you use
 parsing error could be occured. We recommend you to use  the <varname>$val_qas</varname> variable whenever possible, as it is the
 <varname>$val_qas</varname> variable whenewer possible, as it is the most safe  safest one from the mentioned alternatives.
 one from the mentioned alternatives.  
   
 </para>  </para>
 <para>  <para>
   
 Very useful and favourite usage of <varname>['sqlw']</varname> option is to  A very useful and favourite usage of the <varname>['sqlw']</varname> option is
 explicitly tell &name; to store <constant>NULL</constant> value instead of  to explicitly tell &name; to store a <constant>NULL</constant> value instead
 empty string for the particular column. Empty string and  of an empty string for the particular column. Empty string and
 <constant>NULL</constant> are two different values. Many people really does  <constant>NULL</constant> are two different values. Many people really do not
 not like empty strings in their tables, thus now they have possibility to  like empty strings in their tables, thus now they have possibility to change
 change them for <constant>NULL</constant> when user simply fills nothing into  them to <constant>NULL</constant> when user simply enters nothing into form
 form input field.  input field.
   
 <example>  <example>
 <title>Storing <constant>NULL</constant> instead of empty string</title>  <title>Storing <constant>NULL</constant> instead of empty string</title>

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top