I am inserting values in a table but it's not working in sequence, see screenshot:
Code:
$query = "insert into msgs values(NULL,'".$sender."','".$receiver."','".$message."','".$state."','".$time."')";
mysql_query($query);
I am inserting values in a table but it's not working in sequence, see screenshot:
Code:
$query = "insert into msgs values(NULL,'".$sender."','".$receiver."','".$message."','".$state."','".$time."')";
mysql_query($query);
First of all don't use mysql, use mysqli. Please check this: The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
Using null when inserting autoincrement is fine (see Devon's first comentary).
When looking at your timestamp (msg_time) i can see that your table is short by another column because they are not in order anyway. This is only an visual shorting and don't affect entries structure, so don't worry.