sqlbase 0.0.3 copy "sqlbase: ^0.0.3" to clipboard
sqlbase: ^0.0.3 copied to clipboard

Dart to php to Sql database

SQLbase #

Dart to php to Sql database

More contribution needed #

This is the repo https://github.com/amazingsammed/sqlbase

Usage #

  1. Download PHP script
  2. Put it in your http directory or www folder of wampserver
  3. Change the initial configuration of the php file
$host = 'YourAddress';
$dbname = 'YourDatatbaseName';
$username = 'YourUsername';
$password = 'YourPassword';
/// this apikey must match with the one you provided
/// in flutter intialization.
$apiKey = '123456';
  1. Initialize the plugin in your flutter app.
Sqlbase.initialize(url: "TheFile.php", key: '123456')

A Complete Guide #

This is the basic complete guide to use sqlbase plugin made by Sammed Technologies

/// Initialize the plugin
Sqlbase.initialize(url: "http://localhost/sqlbase.php", key: '123456');


final mydb = Sqlbase();

// To  read all data from a table
await myDB.table("tablename").get();


// To  insert  data into a table
await myDB.table("tablename").add(
{
    "name" : 'Flutter',
    "year" : 2015
});

// To  update  data in a table
await myDB.table("tablename").record("1",column:"id").update(
{
    "name" : 'Nextjs',
    "year" : 2019
});


// To  delete  data in a table
await myDB.table("tablename").record("1",column:"id").delete();

Methods for table #

  • .where("name", isEqualto: "Sammed")
  • .isEqualTo("name":"Sammed")
  • .limit(10)
  • .orderBy("id","ASC")
  • .groupBy("gender")
0
likes
0
points
27
downloads

Publisher

unverified uploader

Weekly Downloads

Dart to php to Sql database

License

unknown (license)

Dependencies

flutter, flutter_web_plugins, http, plugin_platform_interface, web

More

Packages that depend on sqlbase

Packages that implement sqlbase