AskDB AI – SQL Query GeneratorAskDB AI – SQL Query Generator
skDB AI is a modern PHP/CodeIgniter SaaS that turns natural language into SQL, with built‑in credits, billing, and a full adminAskDB AI – SQL Query Generator
skDB AI is a modern PHP/CodeIgniter SaaS that turns natural language into SQL, with built‑in cred...
Overview
AskDB AI is a production‑ready, credit‑based SaaS application that lets your users query relational databases using plain English instead of SQL. Powered by OpenAI GPT models, it can generate, optimize, debug and execute SQL queries, create reports, build charts, and provide AI‑driven insights on top of your data.
The platform includes a complete authentication system, user dashboard, credit packages, simulated billing flow, and a polished admin panel to monitor users, payments, queries, and API settings. Built on CodeIgniter 3 and Bootstrap 5, AskDB AI is easy to deploy on any standard LAMP stack and simple to customize or extend for client projects or white‑label SaaS offerings.
Features
- Natural language to SQL
- Convert user questions into executable SQL.
- Supports generation, optimization, and debugging of SQL queries.
- AI‑powered analytics
- Insights: generate SQL, execute it, and explain the results.
- Report generator: full report SQL from a description.
- Chat assistant for SQL help and explanations.
- Charts & ER diagrams
- Chart.js integration to visualize query results.
- ER diagram view from uploaded schema definitions.
- Credit‑based billing system
- Configurable credit packages (Starter, Pro, Business).
- Per‑feature credit usage (query, chat, insights, reports, optimizer, debugger).
- Simulated checkout flow ready to be wired to Stripe/PayPal.
- User management
- Email/password registration and login with bcrypt hashing.
- Free credits on registration (configurable).
- Query history, saved queries library, templates, and schema management.
- Block/unblock users from the admin panel.
- Admin panel
- Dashboard with key metrics (users, queries, revenue approximation, credits used).
- Manage users, payments, and recent queries.
- Settings page to configure OpenAI API key, model, and endpoint (including Azure/OpenAI‑compatible endpoints).
- Secure architecture
- Session‑based authentication (user and admin separated).
- CSRF protection, XSS escaping helpers, and prepared statements / Query Builder.
- API keys stored in the database
settingstable.
- Modern UI/UX
- Bootstrap 5.3 + Bootstrap Icons.
- Clean, responsive layouts for both user dashboard and admin panel.
- Extensible codebase
- CodeIgniter 3 MVC structure.
- Reusable OpenAI libraries for SQL, chat, insights, charts, and reports.
- Helper functions and hooks for centralized AI configuration and overrides.
Requirements
- Server requirements
- PHP 7.4+ (PHP 8.x recommended)
- MySQL 5.7+ or MariaDB 10.3+
- Apache (with
mod_rewrite) or Nginx equivalent - PHP extensions: cURL, JSON, MBString, OpenSSL
- Composer not required (classic CI3 project)
- Client requirements
- Modern browser (Chrome, Firefox, Edge, Safari)
- JavaScript enabled
- External services
- OpenAI API key (or compatible provider/Azure endpoint)
Instructions
- . Upload files
- Upload the
askdbfolder to your web root, e.g.htdocs/askdborpublic_html/askdb.
- Upload the
- 2. Create database
- Create a new MySQL/MariaDB database (e.g.
askdb) withutf8mb4charset.
- Create a new MySQL/MariaDB database (e.g.
- 3. Import SQL schema
- In this order, import:
database/askdb_schema.sqldatabase/admin_tables.sqldatabase/saved_queries_table.sqldatabase/chat_messages_table.sqldatabase/settings_table.sql- (Optional migration)
database/add_credits_used.sql
- In this order, import:
- 4. Configure database connection
- Edit
application/config/database.phpand set:hostname,username,password,databasefor your server.
- Edit
- 5. Set base URL
- Edit
application/config/config.php:$config['base_url'] = 'https://yourdomain.com/askdb/';(adjust to your domain/path).
- Edit
- 6. Configure OpenAI
- Option 1 (recommended): Log in as admin and go to
Admin → Settingsto set your:- OpenAI API key
- Model (e.g.
gpt-4o-mini) - Endpoint (default
<a href="https://api.openai.com/v1/chat/completions">https://api.openai.com/v1/chat...</a>)
- Option 2: Put the API key in environment variable
OPENAI_API_KEYor editapplication/config/openai.php.
- Option 1 (recommended): Log in as admin and go to
- 7. Admin access
- Default admin:
- Email:
[email protected] - Password:
admin123
- Email:
- Log in at
/adminand change the admin password immediately.
- Default admin:
- 8. User access
- Frontend login page:
/auth/login(or/loginif routed). - New users can register, get starter credits, upload their database schema, and start using AI‑powered SQL tools.
- Frontend login page:
Other items by this author
|
PHP Script Installation Service
Don't worry about the installation of your script! Have your PHP Script installed for you.
|
$39 | Buy now |
| Category | Scripts & Code / PHP Scripts / Database |
| First release | 16 March 2026 |
| Last update | 16 March 2026 |
| Software version | PHP 7.4, PHP 8.0, PHP 8.1, PHP 8.2, PHP 8.3, PHP 8.4 |
| Files included | .php, .css, .html, .sql, Javascript .js |
| Tags | php codeigniter codeigniter 3 saas openai gpt ai sql generator analytics credit system query builder natural language to sql sql optimizer sql debugger bootstrap 5 |








