lims Posted December 27, 2021 Share Posted December 27, 2021 connection to onApp is work but get to many error_log in table mysql tblerrorlog in line : 5 public static function useCurrentConnection() { if (class_exists('\Illuminate\Database\Capsule\Manager') && \Illuminate\Database\Capsule\Manager::connection()->getPdo()) { self::$_instance->connection['default'] = (\Illuminate\Database\Capsule\Manager::connection()->getPdo()); } else { self::$_instance = new self(); self::$_instance->connection['default'] = false; } } can someone help how to fix, i got many query in tblerrorlog Regards 0 Quote Link to comment Share on other sites More sharing options...
0 PUQ Posted December 20, 2022 Share Posted December 20, 2022 It looks like you are encountering an error when attempting to establish a database connection in your PHP code. The error message mentions the tblerrorlog table, which suggests that the issue may be related to a logging system that is capturing errors and storing them in a database table. Based on the code snippet you provided, it appears that you are using the Laravel framework and its database component, called Eloquent. The useCurrentConnection method appears to be trying to check whether a database connection has already been established using Eloquent, and if so, it attempts to use that connection. If no connection is found, it creates a new connection using the self::$_instance = new self(); line. It is possible that the issue you are experiencing is related to an error that is occurring when trying to establish a new database connection. This could be due to a variety of factors, such as incorrect database credentials, a misconfigured database server, or a connectivity issue. To troubleshoot this issue, you could try the following steps: Check the database credentials that you are using to ensure that they are correct. This includes the database host, username, password, and database name. Verify that your database server is running and accessible. This could involve checking the status of the database service, checking firewall rules, or ensuring that the server is reachable from the machine where your code is running. Check the tblerrorlog table to see if there are any error messages or stack traces that might provide more information about the issue you are experiencing. Try establishing a manual database connection using a tool such as MySQL Workbench or the mysql command-line client to see if the issue is specific to your code or if it is a general connectivity issue. If you are using a framework such as Laravel, check the documentation or forums for any known issues or troubleshooting tips that might be relevant to your situation. 0 Quote Link to comment Share on other sites More sharing options...
Question
lims
connection to onApp is work but get to many error_log in table mysql tblerrorlog in line : 5
public static function useCurrentConnection() { if (class_exists('\Illuminate\Database\Capsule\Manager') && \Illuminate\Database\Capsule\Manager::connection()->getPdo()) { self::$_instance->connection['default'] = (\Illuminate\Database\Capsule\Manager::connection()->getPdo()); } else { self::$_instance = new self(); self::$_instance->connection['default'] = false; } }
can someone help how to fix, i got many query in tblerrorlog
Regards
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.