Jump to content
  • 0

[errorlog] Creating default object from empty value


lims

Question

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

  • 0

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:

  1. Check the database credentials that you are using to ensure that they are correct. This includes the database host, username, password, and database name.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated