Hack Forums
[PHP] Problem solved - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [PHP] Problem solved (/showthread.php?tid=5700883)



Problem solved - Villezzai - Aug 22, 2017

Thanks for the help ;)))))))


* - Lucifer Morningstar - Aug 22, 2017

Replace it with:
PHP Code

<?php 
$date 
= date('Y-m-d H:i:s',time()); 

Make sure the row has the proper type (timestamp).


* - Villezzai - Aug 22, 2017

(Aug 22, 2017 01:43 PM)Lucifer Morningstar Wrote:  Replace it with:
PHP Code

<?php 
$date 
= date('Y-m-d H:i:s',time()); 

Make sure the row has the proper type (timestamp).

Hmm, still doesn't work. No errors or anything, the data just won't show up on phpMyAdmin.


* - Vana - Aug 22, 2017

PHP Code

<?php 
INSERT INTO table_users 
(username, password, email, fullname, gender, level, avatar, admin_access, views, date_registered) VALUES ('', '$username', '".hashPassword($password)."', '$email', '$firstname $lastname', '$gender', '0', 'default.png', '0', '$date') 
Well that query is messed up. You have everything shifted to the right as you insert '' into the `username` column and continue from there. You're also missing a value for the `views` column.

Should be something like:
PHP Code

<?php 
INSERT INTO table_users 
(username, password, email, fullname, gender, level, avatar, admin_access, views, date_registered) VALUES ('$username', '".hashPassword($password)."', '$email', '$firstname $lastname', '$gender', 0, 'default.png', 0, 0, '$date') 

Not sure what your column types are so the integers might need to be changed to strings.