We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9222f5d + cabc464 commit 8c8e68fCopy full SHA for 8c8e68f
scripts/create_account.php
@@ -43,6 +43,21 @@
43
44
$auth = new Hm_Auth_DB($config);
45
46
+$dbh = Hm_DB::connect($config);
47
+if ($dbh) {
48
+ try {
49
+ $result = $dbh->query("SELECT 1 FROM hm_user LIMIT 1");
50
+ } catch (Exception $e) {
51
+ fwrite(STDERR, "Error: Required table 'hm_user' does not exist in the database.\n" .
52
+ "You may need to initialize the database structure first.\n" .
53
+ "Run: php ./scripts/setup_database.php\n");
54
+ exit(2);
55
+ }
56
+} else {
57
+ fwrite(STDERR, "Error: Unable to connect to the database.\n");
58
59
+}
60
+
61
if ($user && $pass) {
62
$auth->create($user, $pass);
63
}
0 commit comments