Jump to content

Recommended Posts

mysql_query("INSERT INTO `users` ( `id` , `username` , `password` , `email` , `rp` , `gender` , `birthday` , `date_registered` )
VALUES (
NULL , '$user', '$pass', '$email', '2500', '$gender', '$birthday', '$date'
);");

 

Can anyone help me make a table structure for that information please :D

Link to comment
https://forums.phpfreaks.com/topic/52157-mysql-table-stucture/
Share on other sites

<?php
mysql_query("CREATE TABLE users(
id INT NOT NULL AUTO_INCREMENT, 
PRIMARY KEY(id),
username VARCHAR(30), 
password VARCHAR(30), 
email VARCHAR(30), 
rp VARCHAR(30), 
gender VARCHAR(7), 
birthday DATETIME, 
)")
or die(mysql_error());  

echo "Table Created!";
?>

 

The lengths (the numbers in the brackets) will have to be changed to suit your needs and I don't know what type of data you are using for gender or date, but this will give you an idea of how to do it. 

Link to comment
https://forums.phpfreaks.com/topic/52157-mysql-table-stucture/#findComment-257275
Share on other sites

Is date in the database set for a Date Format?  If so the date format for MySQL is Y-m-d (2007-05-19).  Inserting anything that is not in that format will be messed up. Now if your Date row is varchar then you shouldn't have a problem using the format you have now. But if it is set for DATE you will have problems.

Link to comment
https://forums.phpfreaks.com/topic/52157-mysql-table-stucture/#findComment-257296
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.