Using WinMySQL Professional


Client generators - Wap generators - PHP WML oriented - «Delete» script




Only accessible when connected and a table is active and very similar to the PHP script «Delete» generator, the «Client generators>Wap generators>PHP WML oriented>'Delete' script» submenu allows PHP script generations which target is to collect the field values from a WML input deck to generate a 'delete' query on the current table and submit it to the database and then to display if the deletion is successful or not.



How to create a server side PHP WML oriented 'Delete' script ?


To create a PHP 'Delete' script, click on the «Client generators>Wap generators>PHP WML oriented scripts>'Delete' script» submenu. It displays the «Script PHP WML generator : 'Delete' script» window, which includes four top fields «MySQL host», «MySQL database», «MySQL user» and «User password» to enter the database connection parameters. By default WinMySQL Professional puts the current connection values, except if you just have generated a WML input deck with the «Input deck requires authentication» checkbox checked using the «Client generators>Web generators>WML input deck» submenu ; in this case, the «User password» stays blank. You must understand these connection parameters will be hard-coded in the PHP script and may be seen by other users on the server. The best solution is to generate first, a WML input deck with the «Input deck requires authentication» checkbox checked, and then to generate a PHP script without any readable password because it will get it dynamically from the WML input deck which has invoked it.


Note : if you plan to generate a script which will be used on another MySQL® server than the current, you must enter the correct connection parameters in the four top fields «MySQL host», «MySQL database», «MySQL user» and «User password».


If your MySQL® target server is owned by an ISP hosting numerous MySQL® servers such as http://www.carpediem-it.com, it's possible that the connection parameters won't be standard (special socket, special TCP Port, ...), then you must insert extra connection informations in the «MySQL host» field respecting the following patterns : hostname:port or hostname:/path_to_specific_socket_filename. For instance, www.winmysql.com:3307 or localhost:/tmp/your_company.mysql.


The «Script PHP WML generator : 'Delete' script» window also includes two listboxes with list management buttons to allow you to choose columns in the left listbox (representing the structure of the current table), picking up to switch these columns to the right listbox (representing the list of variables that the script will look up in the WML input deck once submited and will use to generate its query).


So, select from the left listbox the first column that you wish ; click on the «>>» button to put it on the right listbox (or just double-click on the column to select). Repeat this operation for every column that you want to be related by the PHP script and click on the «Generate script» button to choose a filename (*.php) to store the generated form (if you have generated, for this script, a WML input deck with submenu «Client generators>Wap generators>WML », you must have already entered the current filename in the top field «URL of script or cgi to be performed after submition of current deck»). Then, export this file to your website by a FTP transfer or any other transfer way.

Note : The checkbox (checked by default) « Posted variables have PHP4 behaviour » may be unchecked to be PHP3 compliant.

Caution : For security reasons, if the connection parameters are hard-coded in the PHP script (because the WML input deck doesn't require any authentication, for instance ), once transfered on the server, you must apply restricting rights on it (typically with a «chmod 700» instead of «chmod 755» often applied by default)



Documentation : WinMySQL Professional 1.16 - © 1999-2003 by Alexandre GOUVERNEUR