Docs – PHP Database Form https://phpdatabaseform.com Generate web form from database. Simple. Fri, 18 Jul 2014 18:15:40 +0000 en-US hourly 1 https://wordpress.org/?v=7.0.4 System Requirements https://phpdatabaseform.com/docs/system-requirements/ Tue, 15 Jul 2014 03:07:40 +0000 http://phpdatabaseform.com/?p=328 PHP Database Form requires web server that supports PHP 5.3 and higher.

  • PHP 5.3 or later
  • Apache, Tomcat, or Microsoft IIS web server

PHP Database Form supports all major databases:

databases_supported

PHP Database Form Supports all major web browsers:

browser_compatibility

]]>
Constructor https://phpdatabaseform.com/docs/constructor/ Tue, 15 Jul 2014 04:02:54 +0000 http://phpdatabaseform.com/?p=335 PHP Database Form constructor takes three parameters. Use this method to create the PHP Database Form object. Usually this is the first line in your code.

Signature:

public function __constructor($sql, $sql_key='id', $sql_table='')

Parameters:

  • $sqlSQL SELECT statement. This is the only SQL statement users needs to implement. The SELECT statement must include the primary key as one of the columns if not using the wildcard start(*) in SELECT statement.
  • $sql_key: The name of the database table primary key. The default is “id”.
  • $sql_tableName of the database table used in the SQL statement. If not defined, the table name is automatically parsed from the SQL statement.

Example:

$dbForm = new C_DatabaseForm("SELECT * FROM employees", "EmployeeID", "employees");
]]>
set_label() https://phpdatabaseform.com/docs/set_label/ Tue, 15 Jul 2014 04:18:00 +0000 http://phpdatabaseform.com/?p=336 set_label(mixed $col, mixed $label) : $this

Set form element label

Parameters

mixed $col
  • Database table column name
mixed $label
  • Label

]]>
set_dimension() https://phpdatabaseform.com/docs/set_dimension/ Tue, 15 Jul 2014 09:02:35 +0000 http://phpdatabaseform.com/?p=339 set_dimension(mixed $col, int $cols, int $rows) : $this

Set control dimension width and height. Note that this is not the same as set_form_dimension().

It is used with text type only. For column type text, the width is translated to “size”, its height is ignored. for text area, the width is translated to “cols” and height to “rows”

Parameters

mixed $col
  • Database table column name
int $cols
  • If the column is a text box, it’s the size that represents number of characters. If the column is a textarea, it’s the value for cols attribute in textarea.
int $rows
  • Optional. Number of rows in a textarea (only)

]]>
set_form_dimension() https://phpdatabaseform.com/docs/set_form_dimension/ Fri, 18 Jul 2014 17:58:13 +0000 http://phpdatabaseform.com/?p=337
set_form_dimension(mixed $f_width, string $f_height) : $this|void

Set form width and height. Overwrites parent definition for template.

Parameters

mixed $form_width
  • Form width
string $form_height
  • Form height
]]>
set_default() https://phpdatabaseform.com/docs/set_default/ Fri, 18 Jul 2014 18:07:42 +0000 http://phpdatabaseform.com/?p=340 set_default(mixed $col, string $default) : $this

Set control default value for a field

Parameters

mixed $col
  • Database table column name
string $default
  • Default value
]]>
set_readonly() https://phpdatabaseform.com/docs/set_readonly/ Fri, 18 Jul 2014 18:09:32 +0000 http://phpdatabaseform.com/?p=341 set_readonly(array $cols) : $this

Set one more more columns as read only field. Note that the parameter is an array.

Parameters

array $cols
  • Column name(s)
]]>
set_required() https://phpdatabaseform.com/docs/set_required/ Fri, 18 Jul 2014 18:10:59 +0000 http://phpdatabaseform.com/?p=342 set_required(array $cols) : $this

Set required fields.  The parameter is an array that can take one or more fields.

Parameters

array $cols
  • Columns name(s)
]]>
set_hide() https://phpdatabaseform.com/docs/set_hide/ Fri, 18 Jul 2014 18:11:36 +0000 http://phpdatabaseform.com/?p=343 set_hide(mixed $col) : $this

Hide a field on the form from displaying with CSS display:none. Note that the field still exists on the form but not visible.

Do not use this field to hide sensitive information such as password.

Parameters

mixed $col
  • Database table column name
]]>
set_placeholder() https://phpdatabaseform.com/docs/set_placeholder/ Fri, 18 Jul 2014 18:12:30 +0000 http://phpdatabaseform.com/?p=344 set_placeholder(mixed $col, mixed $ph_text) : $this

Placeholder text for HTML form element.

Parameters

mixed $col
  • Database table column name
mixed $ph_text
  • Placeholder text

]]>