I am trying to populate the joindate field in my database when a user joins the Members Section. This is what I've come up with but everytime the new user hits the "APPLY" button all of the information is recorded to the users table except the joindate field
///Users Table - Joindate Field\\
Field =joindate
Type =BIGINT
Length/Values* =20
Attributes = empty
Null = not null
Default** = 0
Extra = empty
///config.php\\
function joindate() {
global $db;
$joindate = mysql_query("SELECT UNIX_TIMESTAMP()");
}
///Apply.php\\
<?php
require "config.php";
include "header.php";
if(empty($password)) {
?>
Fill in ALL fields.<br>
<table border="0" cellspacing="0">
<form action="<?=$PHP_SELF;?>" method="post">
<tr><th align="left" valign="top">Username:</td><td><input type="text" name="username"><br><small>(to login with)</small></td></tr>
<tr><th align="left" valign="top">Display name:</td><td><input type="text" name="screename"><br><small>(what people see in-site)</small></td></tr>
<tr><th align="left" valign="top">Email:</td><td><input type="text" name="email"></td></tr>
<tr><th align="left" valign="top">Password:</td><td><input type="password" name="password"></td></tr>
<tr><td colspan="2" valign="top"><input type="submit" value="Apply"></td</tr>
</form>
</table>
<?php
} else {
dbcnx();
mysql_query("INSERT INTO $db[users] (username,screename,password,email,scheme) VALUES ('$username','$screename','$password','$email','$cfg[scheme]')");
mysql_query("INSERT INTO $db[users] (joindate) VALUES ('$cfg[joindate]')");
$message = "Your account at $cfg[title] is as follows:\n\nUsername: $username\nPassword: $password\nLogin at: $cfg[site]\n\nThank you for choosing our community";
mail($email,$cfg[subject],$message,"From: DCS <$cfg[email]>");
print "Thank you, your application has been submitted. <a href=\"./index.php\">Main Page</a>";
}
include "footer.php";
?>
New to PHP but I think i'm on the right track. Any help would be greatly appreciated.