I have a database and want to select an entry with DELPHI and FIREMONKEY CROSSOVER. But I never worked with SQL on DELPHI. And I cant figure out how to connect to the DB with DELPHI. I dont want a hand full of components. It should be an easy connection, like it is with PHP.
I use XAMPP - mySQL. Let's say we have a database, "db_x", with a tabel "users", in that table there is the following entry: name: Michael; surname: Schneider; age: 22.
The Database is on "localhost" or somewhere else, login is "root" and password is "rootpw". To connect to the DB in PHP we use:
mysql_connect("localhost","root","rootpw") or die ("Connection Error");
mysql_select_db("db_x") or die ("Error DB");
Now I wanna get the surname from a user named "Michael":
$query= mysql_query("SELECT surname FROM users WHERE name = 'Michael'")
or die
(mysql_error());
while($zeile = mysql_fetch_array( $query ))
{
echo $zeile['surname']."<br>";
}
Now this is about PHP, but what about DELPHI? I have the same database and want to show the surname of the user but I dont even know how to connect with DELPHI (and it should also support Firemonkey and work on iOS).
Sorry for the grammar misstakes I made.
Thanks for all incoming answers and regards from germany.