Database Error Please try again.

Started by perfec2, June 14, 2020, 07:53:56 AM

Previous topic - Next topic

perfec2

Hello Gurus,

When a person tries to register on my forum after putting all the detail and click submit below error occurs:

"Database Error
Please try again. If you come back to this error screen, report the error to an administrator."

Please how can I fix this?

Thank you in advance

Decent_946

Are you using any mods to add/ask some additional data on registration? i.e country flags, pm on registration, etc. The issue seems to be with a DB query. Although reported before.

Also, check your forum error log - it will have more information on the specific error.
Thankx to RebellioN

perfec2

Yes, I use mod to ask some questions as you mentioned. But I have disabled it, yet the problem still persists.

Below is the error log:

"[14-Jun-2020 12:45:11 UTC] PHP Deprecated:  Function create_function() is deprecated in /home/username/public_html/Sources/Load.php on line 273
[14-Jun-2020 12:45:12 Africa/Abidjan] PHP Deprecated:  Function create_function() is deprecated in /home/username/public_html/Sources/Subs.php on line 1088"


perfec2


Doug Heffernan

Quote from: perfec2 on June 14, 2020, 09:15:16 AM
Quote from: Doug Heffernan on June 14, 2020, 09:12:47 AM
What are your Smf and php versions?

Version: SMF 2.0.17,  PHP 5.6

There you go. You must upgrade your php at least to 7.2 which is officially supported by Smf 2.0.17.

perfec2

Quote from: Doug Heffernan on June 14, 2020, 11:39:24 AM
Quote from: perfec2 on June 14, 2020, 09:15:16 AM
Quote from: Doug Heffernan on June 14, 2020, 09:12:47 AM
What are your Smf and php versions?

Version: SMF 2.0.17,  PHP 5.6

There you go. You must upgrade your php at least to 7.2 which is officially supported by Smf 2.0.17.

I have upgraded the PHP to 7.2, yet new users can't sign up.  The error is still showing.

lurkalot

Quote from: perfec2 on June 14, 2020, 12:04:49 PM
Quote from: Doug Heffernan on June 14, 2020, 11:39:24 AM
Quote from: perfec2 on June 14, 2020, 09:15:16 AM
Quote from: Doug Heffernan on June 14, 2020, 09:12:47 AM
What are your Smf and php versions?

Version: SMF 2.0.17,  PHP 5.6

There you go. You must upgrade your php at least to 7.2 which is officially supported by Smf 2.0.17.

I have upgraded the PHP to 7.2, yet new users can't sign up.  The error is still showing.

2.0.17 should work fine on php 5.6 anyway according to, https://wiki.simplemachines.org/smf/SMF2.0:Requirements_and_recommendations

Doug Heffernan

@perfec2, can you tell us what mods do you have installed? What was the latest change to the forum prior to this starting to happen?

perfec2

Yes my hosting allows switching to versions. But my issue persists, please what do I need to do so people can signup without issue?
Also where can I disable "OpenID" in the signup page?

Quote from: Doug Heffernan on June 14, 2020, 12:18:39 PM
@perfec2, can you tell us what mods do you have installed? What was the latest change to the forum prior to this starting to happen?

I am not sure when it started, but we moved to a new hosting. Also, I removed all the mods and uploaded SMF fresh files, no luck.

Doug Heffernan

Quote from: perfec2 on June 14, 2020, 12:30:59 PM
Yes my hosting allows switching to versions. But my issue persists, please what do I need to do so people can signup without issue?
Also where can I disable "OpenID" in the signup page?

Quote from: Doug Heffernan on June 14, 2020, 12:18:39 PM
@perfec2, can you tell us what mods do you have installed? What was the latest change to the forum prior to this starting to happen?

I am not sure when it started, but we moved to a new hosting. Also, I removed all the mods and uploaded SMF fresh files, no luck.

You can disable OpenID at the Settings page for the Registration. The setting you need for that is called: Allow users to register using OpenID

Did you run the repair_settings.php file after the move? If you did not, try to run it now and see if it would help.

https://wiki.simplemachines.org/smf/Repair_settings.php

perfec2

After moving to this new host, I did run Repair_settings.php and tried again now. But the error is still there.

Doug Heffernan

Can you attach here those 2 files mentioned in the error message? (Load.php and Subs.php)

P.s. Here you can read up on the cause of that particular error.

https://www.php.net/manual/en/function.create-function.php#:~:text=This%20function%20has%20been%20DEPRECATED,this%20function%20is%20highly%20discouraged.


perfec2

The Load.php and Subs.php files attached.

Sir Osis of Liver

You shouldn't be getting 'Deprecated:  Function create_function()' in php 5.6.  Some crappy hosts will report incorrect php version.  Try running phpinfo.php (attached).
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

perfec2

I uploaded the phpinfo.php,  the  PHP Version is 7.2.31

Sir Osis of Liver

The deprecated function error should not prevent registration.  If you've uploaded clean files the problem is either in your database or the server.  Can you get to server errorlog or view errors in cpanel?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

perfec2

I contacted the host, they replied: "I can find no cause of the error. A database restore does not fix it. Knowing what the database error is would be the best fix I believe".

I have done the following yet no fix:

I replaced all the SMF files
I updated to the latest version
Deactivated all mods and enable them back
My host copied all its files and database from the old VPS to this new one.
I switched to different PHP versions from 5.6 to 7.2 version, it still can't work.
New member can't sign up https://cokoye.com/register/
The forum is https://cokoye.com

I tried registering a new member from admin, and got the error:

"Field 'breeze_profile_views' doesn't have a default value
File: /home/username/public_html/Sources/Subs-Members.php
Line: 772

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.17, while your database is at version 2.0.13. The above error might possibly go away if you execute the latest version of upgrade.php."

What is the way out to fix this?

Arantor

Change the smf_members table, in the breeze_profile_views column, and allow it to be null.

perfec2

Quote from: Arantor on June 18, 2020, 08:31:47 AM
Change the smf_members table, in the breeze_profile_views column, and allow it to be null.

I log into Cpnel, PHPMYADMIN I didn't see breeze_profile_views column, I only saw the following:
smf_breeze_comments
smf_breeze_notifications
smf_breeze_options
smf_breeze_status

Please can I PM you my Cpanel detail so that you help fix it?

Arantor

It's not a table called that, it's going to be the smf_members table looking at the error you have.

And please, no, I don't want cPanel logins - ever.

perfec2

Please give steps on how to locate the breeze_profile_views column, and allow it to be null.

Thank you for your assistance.

Kindred

those are tables, not columns.

As Arantor said -- in the smf_members table, find the  breeze_profile_views  column and give it a default value of NULL
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

perfec2

Quote from: Kindred on June 19, 2020, 09:52:58 AM
those are tables, not columns.

As Arantor said -- in the smf_members table, find the  breeze_profile_views  column and give it a default value of NULL
I understand, the question is how could I do that? Please put me through step by step and let me know the query to run or what?

Arantor

So you went into phpMyAdmin, right? Click on smf_members in the list of tables, then the Structure tab in that, you should then see the breeze_profile_views column. You can then edit that column, tick the box next to 'null' and hit save.

perfec2

Quote from: Arantor on June 19, 2020, 03:01:05 PM
So you went into phpMyAdmin, right? Click on smf_members in the list of tables, then the Structure tab in that, you should then see the breeze_profile_views column. You can then edit that column, tick the box next to 'null' and hit save.


This solved it. 
Now new members can signup without issues.

Thank you Arantor, Sir Osis of Liver, Doug Heffernan, and all that contributed.


Advertisement: