I'm totally new to this and to be honest I'm struggling to even find any basic documentation/tutorials on the subject.
I'm using Embacadero HTML5 Builder to try and create an iphone basic app
I have a basic form with 2 edit boxes and a button. All I'm trying to do is when the user clicks the button, it takes the username and password from the edits and trys to connect to a sql server (2012).
I know the IP address of the server and the database name.
If the connection fails due to incorrect logon, then a warning message is displayed. If the connection works, then it should open up the "next" page, whatever that is.
All I have so far, which I know doesn't work is below, but you get the general gist.
function btnLoginClick($sender, $params)
{
$mysqlsvr = new SQLConnection('10.10.1.27', $edUsername.Text, $edPassword.Text, 'exp_main');
$mysqlsvr.open;
if fails then
WARNING
else
Open new page
}
I'd like to pass this database connection through if connects fine, or just store it somewhere globally for use.
Thanks
You are using the wrong identifiers to access the username and password entered by the user.
$text = $this->ComponentName->Text; // Right.
$text = $ComponentName.Text; // Wrong.
To configure an MSSQL connection with HTML5 Builder, follow these pages of the documentation:
HTML5 Buider also includes a tool, the Data Explorer, which you can use to connect the IDE itself to your server, so you can drag and drop tables into the Designer to generate the components for the connection, instead of creating and configuring those manually.
Finally, I see you are using Delphi-like code for your event handler. HTML5 Builder is an Embarcadero product, yes, but it uses web programming languages such as JavaScript or PHP. For server-side event handlers, you must use the latter.
While you do not need a high level of PHP for using HTML5 Builder, you should learn the basics. The H5B documentation includes some pages with references to PHP documentation resources and tutorials. I would start with the W3Schools Tutorial, which will give you the basics, and you will find out the official PHP documentation, while a bit messy in some aspects, is really helpful and convers almost everything you might ever need.