Weird MYSQL stuff ...

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
TJK
Registered User
Posts: 100
Joined: Sat Dec 26, 2015 9:10 pm
Name: Tolaso J Kos
Contact:

Weird MYSQL stuff ...

Post by TJK » Fri Nov 22, 2019 12:11 pm

I'm creating the backend of our local club and I'm using PHP to send and retrieve data from the server. However, I ran into weird stuff lately. Well, in the database I have the table members and is created like this:

Code: Select all

$members_sql = "CREATE TABLE members (
ID INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(100) NOT NULL,
Email VARCHAR(100) NOT NULL,
Telephone VARCHAR(100) NOT NULL,
Cell VARCHAR(100) NOT NULL,
Home VARCHAR(100) NOT NULL,
TIN VARCHAR(100) NOT NULL,
MSCode VARCHAR(100) NOT NULL,
Status VARCHAR(100) NOT NULL,
Job VARCHAR(100) NOT NULL,
Reg_Date TIMESTAMP,
GDPR VARCHAR(100) NOT NULL,
SMS VARCHAR(100) NOT NULL,
MAILTO VARCHAR(100) NOT NULL,
)";

I went on to alter the table to add a column Expire that basically adds the expire date of the membership of the member. It increments the REG_DATE column by 1 year. So far so good , the table has been altered , the column has been added. However, the REG_DATE has also been altered and now displays the current date instead of the actual date that the registration took place.

Is this normal or am I missing something? The site is still in beta mode and no-one will notice it but out of curiosity. How do you normally alter tables?

P.S: This is not a support question. Just asking if this is the intended behaviour and how you guys go altering tables using PHP .

User avatar
david63
Registered User
Posts: 16845
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Weird MYSQL stuff ...

Post by david63 » Fri Nov 22, 2019 12:43 pm

Is this phpBB related?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

TJK
Registered User
Posts: 100
Joined: Sat Dec 26, 2015 9:10 pm
Name: Tolaso J Kos
Contact:

Re: Weird MYSQL stuff ...

Post by TJK » Fri Nov 22, 2019 12:48 pm

No, David! This is not phpbb and I just realised that I posted it in the wrong forum. It should have been at "General Discussion". :? I'm just asking it for my personal curiosity.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66930
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Weird MYSQL stuff ...

Post by Lumpy Burgertushie » Fri Nov 22, 2019 12:50 pm

you would be better off at a support site for php and /or mysql.

luck,
robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

TJK
Registered User
Posts: 100
Joined: Sat Dec 26, 2015 9:10 pm
Name: Tolaso J Kos
Contact:

Re: Weird MYSQL stuff ...

Post by TJK » Fri Nov 22, 2019 12:51 pm

Hi Robert,

as I said it the first message this is not a support question. I'm just asking if someone has seen this before and if he/she knows if this is the intended behaviour. Other than that, I'll go down this path since the site is not online so no-one will bother.

User avatar
david63
Registered User
Posts: 16845
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Weird MYSQL stuff ...

Post by david63 » Fri Nov 22, 2019 1:23 pm

Did you consider doing a Google search on "mysql timestamp behaviour"?

If you did you would find that depending on how you have your table set up it enters the current date/time
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

TJK
Registered User
Posts: 100
Joined: Sat Dec 26, 2015 9:10 pm
Name: Tolaso J Kos
Contact:

Re: Weird MYSQL stuff ...

Post by TJK » Fri Nov 22, 2019 1:46 pm

Hi David,

I did actually but probably with the wrong key words. Anyway, thanks for sharing ! Consider my question answered!

Post Reply

Return to “phpBB Custom Coding”