There's a couple of ways of using the addslashes() with an INSERT command (the syntax below should be close).
1.
$query = "INSERT INTO table VALUE ('".addslashes($foo)."',".time().")";
or 2.
$foo = addslashes($foo);
$query = "INSERT INTO table VALUE ('$foo',".time().")";
or 3.
$query = sprintf("INSERT INTO table VALUES "."('%s',$d)",addslashes($foo),time());
You might also look at www.php.net for the PHP manual and search for addslashes() or magic_quotes.
Hope that helps.
Rob