yTakkar / Instagram-clone

An Instagram-clone with my own flavors and features. Own the project with 5 simple steps!! 📸💝☢️ - No longer maintained.
MIT License
572 stars 250 forks source link

Column "logout" should have a default value #45

Closed irwandj closed 6 years ago

irwandj commented 6 years ago

Dear Faiyaz,

First, thank you very much for sharing your hard work! One small fix : in the "login" table, I have put a default NULL value for "logout". Irwan

yTakkar commented 6 years ago

Thank you @irwandj Actually there's a logic behind not having a NULL value for logout column, it helps in config/class/universal.class.php's isOnline method. Have a look at this https://github.com/yTakkar/Instagram-clone/blob/ac3c26084f58a8f692e00efcc1240a06f9c7ca61/config/class/universal.class.php#L121

irwandj commented 6 years ago

OK, I see. I have tried to fix this error: [27-Dec-2017 10:02:29 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1364 Field 'logout' doesn't have a default value in ...\config\class\login.class.php:41

I see 2 solutions: in the database > ALTER TABLEloginCHANGElogout`logout DATETIME NOT NULL DEFAULT '0000-01-01 00:00:00'; or in login.class.php,INSERT INTO login(`

What do you think about it?

yTakkar commented 6 years ago

Acutally, I've stopped maintaining this project, why not you use another version of this project which is much faster, reactive and a single-page application. Another Version