son Posted October 26, 2011 Share Posted October 26, 2011 I am trying to insert a string into db which is made of timestamp, dash as separator and unique id as$insertString = $timeNow . "-" . $ID; Problem is that is subtracts the id from the timestamp rather than treating the dash as a separator. What would be best to do? Son Link to comment Share on other sites More sharing options...
westman Posted October 26, 2011 Share Posted October 26, 2011 $sql = mysql_query("INSERT INTO table (date) VALUES(now())") or die (mysql_error()); Link to comment Share on other sites More sharing options...
Ingolme Posted October 26, 2011 Share Posted October 26, 2011 Are you putting it in quotes in your SQL query? "INSERT ... ... '{$insertString}' ... " Link to comment Share on other sites More sharing options...
son Posted October 26, 2011 Author Share Posted October 26, 2011 The quotes solved the issue. Many thanks. Did not think about this... Son Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.