Hi,
I have and field sessions which is created by unique random numbers..the field is a varchar (30)..
my problem now is that when I test if same session and id exist, then don't add to the table, it can't test the session variable..
I'm thinking the problem is the session varchar.. because before I used to use session as INT and it works..
To test this further, I stripped the testing of session and only test the id.. and it's working... if id is the same, the item will not be added to the table.
here are portions of my scripts:
$session = md5(uniqid(rand())); (session is varchar (30) not null default=0 )
$result = mysql_query( "SELECT * FROM $table WHERE session='$session' AND id='$id'");
$num_rows = mysql_num_rows($result);
if($num_rows == 0)
{
$sql = "INSERT INTO ..blah blah blah.
}
else;
that didnt work caus it didnt recognize the same session. (in mysql table, it shows same id and session has been added)