Tired of Writing Repetitive SQL?Writing secure SQL can often feel like a chore, leading to bloated code that not only wastes a developer's time but can also increase the risk of errors. But with Sonic SQL, you can:
All in one line of code!
|
![]() |
Getting Started with Sonic SQLOnce you've downloaded SQL.zip, extract the contents and move or upload them to whichever location you're working in. The files you need are ssql.php, ssql.js, and connect.php Connect to your database – This is your default mysqli connection in connect.php. $server = "localhost"; $username = " "; $password = " "; $database = " db_name"; Include or Require – Simply include or require ssql.php to write fast, secure queries in php require "path/to/ssql.php"; Script – Call ssql.js to write fast, secure queries in JavaScript <script src="path/to/ssql.js"></script> $connect – An optional parameter that connects to your database and falls back to your default connection in ssql.php if not included ssql($connect, "SELECT * FROM users WHERE name LIKE ?", ["J%"], "json"); Query – A standard MYSQL query where you must replace all values with ? ssql("SELECT * FROM users WHERE name LIKE ?", ["J%"], "json"); Values – Enter your values in order and in square brackets [ ] separated by commas, with strings in quotations. ssql("SELECT * FROM users WHERE age > ? AND name LIKE ?", [30, "J%"], "json"); - Or - $values = [30, "J%"]; ssql("SELECT * FROM users WHERE age > ? AND name LIKE ?", $values, "json"); Format – This tells Sonic SQL how you want to return the data View Modes ssql("SELECT * FROM users WHERE name LIKE ?", "J%", "json"); |
Download & Installation
- Download Sonic SQL and extract the zip file.
- Move "SonicSQL" to the path or folder you're working in.
- In PHP: Include or require ssql.php in your file.
- In JS: Call ssql.js in script tags.