Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ;
- import haxe.remoting.Connection;
- import php.db.Mysql;
- import php.db.ResultSet;
- import php.Session;
- import php.Lib;
- import php.Web;
- /**
- * ...
- * @author S............
- */
- class Main {
- static function main() {
- var param = Web.getParams();
- var nm = param.exists('name') ? param.get('name') : 'none';
- var id = param.exists('id') ? param.get('id') : 'none';
- if (nm == 'none' && id == 'none') {
- Lib.print('<a href="form_example.html">Log In</a>');
- } else {
- Lib.print('Name: ' + nm + '<BR><BR> ID: ' + id);
- }
- var connection = php.db.Mysql.connect ( {
- host: "localhost",
- port: 3306,
- user: "root",
- pass: "",
- socket: null,
- database: "test"
- });
- var rs:ResultSet = connection.request( "SELECT * FROM users" );
- for (i in rs) {
- Lib.print(i);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement