I have a database that stores a Timestamp field, I am using this timestamp as the id for each row. I am sending users an email with this id in it, so when they click on the link it goes to the page and the id shows up in the url. I am then pulling the data from the url and using the following select statement to pull the correct row from the database: $result = mysql_query("SELECT * FROM send WHERE ids = {$id}", $db); The problem is that it is never pulling the data. Is it a problem with the statement itself? Or is it a problem with comparing the variable to timestamp?
Any help would be great. Thanks
try this
//put the sql in it's own statement $query = "SELECT * FROM send WHERE ids = $id"; //print the statement to test the variables echo $query; //run the query $result = mysql_query("$query,$db); //test the result.
hth
Bastien
Thanks, I tried that but this is the value I get:
1038299210 SELECT * FROM send WHERE ids = 1038299210 Resource id #2
and here is the code: $sql = "SELECT * FROM send WHERE ids = $id"; echo $sql; $result = mysql_query($sql,$db); echo "{$result}";