MySQL_Connect_to_Database.zip (2009-02-24) (Downloaded 53 times)
Compatible: Pro 3.5, Pro 4, and Pro 5
Author: Softpress Support
MySQL Connect generates PHP code so that the page can connect to a database. It has two settings, one for development and one for when the page is hosted on a server that is on line. Code created by this Action can be inserted onto another page using the Action ‘Include PHP Page’.
This Action is a Page Action. Enter your database information in the text fields. The drop-down determines which set of data will be used. Switching this will cause all pages that use the PHP Include PHP Page to include this page to re-publish.
This is HTML generated by a blank Freeway page with this Action applied. The variable $fwServer will be 1 for development and 2 for live (just in case you need to make minor changes to code to allow for differing environments).
$fwDBName = “name”;
$fwHost = “host”;
$fwUser = “user”;
$fwPassword = “password”;
$fwLink = mysql_connect( $fwHost , $fwUser , $fwPassword );
$kfwDevelopment = 1;
$kfwLive = 2;
$fwServer = 1;