https://github.com/dg/mysql-check
Checks a MySQL database for invalid foreign keys, i.e., a keys pointing to missing rows.
https://github.com/dg/mysql-check
invalid-foreign-keys mysql-database php
Last synced: 3 months ago
JSON representation
Checks a MySQL database for invalid foreign keys, i.e., a keys pointing to missing rows.
- Host: GitHub
- URL: https://github.com/dg/mysql-check
- Owner: dg
- License: bsd-3-clause
- Created: 2013-06-22T14:03:24.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2020-05-11T22:47:18.000Z (over 5 years ago)
- Last Synced: 2025-01-31T22:11:41.435Z (12 months ago)
- Topics: invalid-foreign-keys, mysql-database, php
- Language: PHP
- Homepage: https://nette.org
- Size: 2.93 KB
- Stars: 14
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license.md
Awesome Lists containing this project
README
MySQLChecker
============
Checks a MySQL database for orphaned records or invalid foreign keys, i.e., keys pointing to missing rows.
Create [MySQLi](http://www.php.net/manual/en/mysqli.construct.php) object and then check database named `blog`:
$mysqli = new mysqli('localhost', 'root', 'password');
checkForeignKeys($mysqli, 'blog');
Or without parameter it checks all databases:
checkForeignKeys($mysqli);
If you like it, **[please make a donation now](https://nette.org/make-donation?to=mysql-check)**. Thank you!