PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Handling the MySQL, Oracle or PostgreSQL data files
  • To handle the MySQL, Oracle or PostgreSQL data files in PHP with the HFSQL functions:
  • Notes
  • The following functions are currently available in PHP:
  • Handling data files via ODBC
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
WEBDEV allows you to create a PHP site that handles data files:
  • in MySQL format. This data can be handled by the SQL functions of WLanguage or by the HFSQL functions of WLanguage. A MySQL database is required.
  • via ODBC. This data can be handled by the SQL functions of WLanguage. You have the ability to handle a data source in HFSQL Classic or HFSQL Client/Server format defined in the ODBC administrator.
  • Versions 15 and later
    in PostgreSQL format. This data can be handled by the SQL functions of WLanguage or by the HFSQL functions of WLanguage. A PostgreSQL database is required and the php_pgsql extension must be enabled in the php.ini file.
    New in version 15
    in PostgreSQL format. This data can be handled by the SQL functions of WLanguage or by the HFSQL functions of WLanguage. A PostgreSQL database is required and the php_pgsql extension must be enabled in the php.ini file.
    in PostgreSQL format. This data can be handled by the SQL functions of WLanguage or by the HFSQL functions of WLanguage. A PostgreSQL database is required and the php_pgsql extension must be enabled in the php.ini file.
  • Versions 15 and later
    in Oracle format. This data can be handled by the SQL functions of WLanguage or by the HFSQL functions of WLanguage. An Oracle database is required, the php_oci8 extension must be enabled in the php.ini file and the Oracle client layer must be found on the server.
    New in version 15
    in Oracle format. This data can be handled by the SQL functions of WLanguage or by the HFSQL functions of WLanguage. An Oracle database is required, the php_oci8 extension must be enabled in the php.ini file and the Oracle client layer must be found on the server.
    in Oracle format. This data can be handled by the SQL functions of WLanguage or by the HFSQL functions of WLanguage. An Oracle database is required, the php_oci8 extension must be enabled in the php.ini file and the Oracle client layer must be found on the server.
Note: PHP version 4.3.2 (or later) is required. The PHP sites generated by WEBDEV can also be used by PHP servers version 5.Note: PHP version 4.3.2 (or later) is required. The PHP sites generated by WEBDEV can also be used by PHP servers version 5 or version 7.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Handling the MySQL, Oracle or PostgreSQL data files

To handle the MySQL, Oracle or PostgreSQL data files in PHP with the HFSQL functions:

The type of the data files described in the project analysis must correspond to the targeted database. The connection to the server is described in the analysis.
If this condition is fulfilled, the data files can be directly handled by the HFSQL functions available in PHP.
The browsing Table controls created in the editor are directly linked to the data files described in the data model editor.

Notes

  • The use of HFSQL functions on queries with the PHP/MySQL access requires a MySQL server version 4.1 or later.
  • When browsing queries (HReadFirst/HReadNext for example), the query may be re-run several times.
  • The names of the files and items found in the database must contain no accented characters and no space characters.
  • Using queries with parameters: If the SQL code of the query was not entirely generated by the query editor, the name of the query parameters must have the following format: {paramX} where X is the number of the parameter in the order of appearance in the query.
    Example: SELECT LastName, FirstName FROM Customer WHERE LastName={Param1} AND FirstName={Param2}

The following functions are currently available in PHP:

Versions 09 and later
FileToPage
New in version 09
FileToPage
FileToPage
Automatically initializes the controls of a page with:
  • the values of the associated items in the current record (loaded in memory) of the data file described in the data model editor. This operation is performed regardless of the status of the controls (grayed, inactive or invisible).
  • the values of the associated WLanguage variables. This operation is performed regardless of the status of the controls (grayed, inactive or invisible).
Versions 09 and later
FileToScreen
New in version 09
FileToScreen
FileToScreen
Automatically initializes the controls found in a window or in a page with:
  • the values of the associated items in the current record (loaded in memory) of the data file described in the data model editor. This operation is performed regardless of the status of the controls (grayed, inactive or invisible).
  • the values of the associated WLanguage variables. This operation is performed regardless of the status of the controls (grayed, inactive or invisible)
Versions 09 and later
HActivateFilter
New in version 09
HActivateFilter
HActivateFilter
Enables the filter that was previously created for the specified data file (view or query).
Versions 09 and later
HAdd
New in version 09
HAdd
HAdd
Adds:
  • the record found in memory into the data file (query or view).
  • the record found in a Record variable into the data file (query or view).
Versions 09 and later
HBackward
New in version 09
HBackward
HBackward
Moves backward several records from the current position in the data file, according to a specified item.
Versions 09 and later
HBuildKeyValue
New in version 09
HBuildKeyValue
HBuildKeyValue
Builds the value of a composite key to implement a filter (HFilter) or to perform a search (HReadSeekFirst, HReadSeekLast, ...).
Versions 09 and later
HCancelDeclaration
New in version 09
HCancelDeclaration
HCancelDeclaration
Used to:
Versions 09 and later
HCancelSeek
New in version 09
HCancelSeek
HCancelSeek
Cancels the current search criterion.
Versions 09 and later
HChangeConnection
New in version 09
HChangeConnection
HChangeConnection
Dynamically changes the connection associated with a data file.
Versions 09 and later
HClose
New in version 09
HClose
HClose
Closes a data file or all the data files opened by the current user: all the corresponding physical data files are closed for the current user.
Versions 09 and later
HCloseConnection
New in version 09
HCloseConnection
HCloseConnection
Closes a connection to a database.
Versions 09 and later
HCreation
New in version 09
HCreation
HCreation
Creates an empty data file (".FIC" extension) with the index file and the memo file if necessary.
Versions 09 and later
HCreationIfNotFound
New in version 09
HCreationIfNotFound
HCreationIfNotFound
Performs the following operations:
  • If the file does not exist, creates an empty data file (".FIC" file) with the index file and the memo file if necessary. The function is equivalent to HCreation.
  • If the file exists, opens the file.
Versions 09 and later
HDeactivateFilter
New in version 09
HDeactivateFilter
HDeactivateFilter
Temporarily disables the filter on a data file (view or query).
Versions 09 and later
HDelete
New in version 09
HDelete
HDelete
Deletes a record from a data file (query or view).
Versions 09 and later
HDescribeConnection
New in version 09
HDescribeConnection
HDescribeConnection
Describes a new connection to an external database.
Versions 09 and later
HError
New in version 09
HError
HError
Returns the number of the last error triggered by the HFSQL engine.
Versions 09 and later
HErrorDuplicates
New in version 09
HErrorDuplicates
HErrorDuplicates
Used to find out whether a duplicate error occurred.
Versions 09 and later
HErrorInfo
New in version 09
HErrorInfo
HErrorInfo
Returns a detailed information about the last error triggered by the HFSQL engine.
Versions 09 and later
HExecuteQuery
New in version 09
HExecuteQuery
HExecuteQuery
Declares a query created in the query editor to the HFSQL engine and runs this query.
Versions 09 and later
HExecuteSQLQuery
New in version 09
HExecuteSQLQuery
HExecuteSQLQuery
Initializes a query written in SQL language and declares this query to the HFSQL engine.
Versions 09 and later
HExtractMemo
New in version 09
HExtractMemo
HExtractMemo
Extracts the content of a binary memo item from a HFSQL file, a query or a HFSQL view into a physical file (on disk).
Versions 09 and later
HFilter
New in version 09
HFilter
HFilter
Defines and enables a filter on a data file, view or query.
Versions 09 and later
HFilterIdentical
New in version 09
HFilterIdentical
HFilterIdentical
Defines and enables a filter used to find the exact value of a string item.
Versions 09 and later
HFilterStartsWith
New in version 09
HFilterStartsWith
HFilterStartsWith
Defines and enables a "Start with" filter on a file, view or query.
Versions 09 and later
HForward
New in version 09
HForward
HForward
Moves several records forward from the current position in the data file, according to a specified item.
Versions 09 and later
HFound
New in version 09
HFound
HFound
Checks whether the current record corresponds to the current filter or to the current search.
Versions 09 and later
HFreePosition
New in version 09
HFreePosition
HFreePosition
Deletes a position saved by HSavePosition.
Versions 09 and later
HGetCurrentPosition
New in version 09
HGetCurrentPosition
HGetCurrentPosition
Returns the approximate position of current record in the data file.
Versions 09 and later
HLinkMemo
New in version 09
HLinkMemo
HLinkMemo
Used to associate a file with a binary memo item or to cancel the existing link between a file and a binary item.
Versions 09 and later
HListConnection
New in version 09
HListConnection
HListConnection
Returns the list of connections currently described in the application.
Versions 09 and later
HListDatabase
New in version 09
HListDatabase
HListDatabase
Lists the Client/Server databases associated with a connection.
Versions 09 and later
HModify
New in version 09
HModify
HModify
Modifies the specified record or the record found in memory in the data file (query or view).
Versions 09 and later
HNbRec
New in version 09
HNbRec
HNbRec
Returns the number of records in a file, a query or a HFSQL view: active records, crossed records, deleted records, etc.
Versions 09 and later
HOpen
New in version 09
HOpen
HOpen
Opens a data file.
Versions 09 and later
HOpenConnection
New in version 09
HOpenConnection
HOpenConnection
Opens a connection to a specific database.
Versions 09 and later
HOut
New in version 09
HOut
HOut
Used to find out whether the record on which you want to be positioned is located outside the data file, filter, view or query.
Versions 09 and later
HReadFirst
New in version 09
HReadFirst
HReadFirst
Positions on the first file record according to a search item.
Versions 09 and later
HReadLast
New in version 09
HReadLast
HReadLast
Positions on the last file record according to a search item.
Versions 09 and later
HReadNext
New in version 09
HReadNext
HReadNext
Positions on next file record according to a search item.
Versions 09 and later
HReadPrevious
New in version 09
HReadPrevious
HReadPrevious
Positions on the previous file record according to a search item.
Versions 09 and later
HReadSeek
New in version 09
HReadSeek
HReadSeek
Positions on the first file record whose value for a specific item is greater than or equal to a sought value (generic search).
Versions 09 and later
HReadSeekFirst
New in version 09
HReadSeekFirst
HReadSeekFirst
Positions on the first file record whose value for a specific item is strictly equal to a sought value (exact-match search).
Versions 09 and later
HReadSeekLast
New in version 09
HReadSeekLast
HReadSeekLast
Positions on the last file record whose value for a specific item is less than or equal to a sought value (exact-match search).
Versions 09 and later
HReset
New in version 09
HReset
HReset
Initializes:
  • one or all variables of file items with their default values.
  • one or all items of a Record variable with their default values.
Versions 09 and later
HRestorePosition
New in version 09
HRestorePosition
HRestorePosition
Restores the file context that was saved beforehand (HSavePosition): current record, filter, pointers.
Versions 09 and later
HSavePosition
New in version 09
HSavePosition
HSavePosition
Stores the current file context: current record, filter, pointers.
Versions 09 and later
ScreenToFile
New in version 09
ScreenToFile
ScreenToFile
Automatically initializes:
  • the memory value of the items of a data file with the value of the controls found in the window or in the page. The items of the base data file linked to the window controls are automatically assigned with the values of the corresponding controls (even if these controls are grayed, inactive or invisible).
  • the value of the WLanguage variables with the value of the controls found in the window or in the page. The WLanguage variables linked to the window controls are automatically assigned with the values of the corresponding controls (event if these controls are grayed, inactive or invisible)
Handling data files via ODBC
To handle data files via ODBC:
  1. Define an ODBC data source.
    To create a data source on HFSQL Classic or Client/Server files, see ODBC driver on HFSQL Classic and Client/Server.
    Note: To use the SQL functions in PHP, you must define a "system" ODBC data source (and not a "user" ODBC data source).
  2. Use SQLConnect to connect to the database. In this case, the type of the database is "ODBC".
  3. Use the SQL functions to handle your data.
Minimum required version
  • Version 10
Comments
Click [Add] to post a comment