php - sql query was working and now not? insert user ip address into table? -


my sql query working fine 5 hours ago , it's not? have not touched thing.

can please me bottom of this, should users ip address , store in table along current time , date, not inserting anything, appreciate help.

here table:

+-------------------------------------------------------------+ |session_id |    user_ip     |    session_start  | session_end| |===========|================|===================|============| |          1|  192.135.123.13|   23:02:20 10:23  | null       | +-------------------------------------------------------------+ 

here sql:

// ip address  $sql = "insert ptb_sessions (session_id, user_ip, session_start, session_end) values (null, '" . $_server['remote_addr'] . "', now(), null);";   mysql_query($sql, $connection); ?>   

go step step.

  1. try inserting simplest data values sets (1, '127.0.0.1', now(), now())
  2. if ok, try adding $_server['remote_addr'] instead of 127.0.0.1

be careful case in tables , columns names.

if 1 not work in php code, try execute sql insert directly mysql gui (mysql workbench example), error should raised.

if insertion works fine mysql gui, check connection parameters in php.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -