Hi can anyone help?
I am designing a music website and want to be able to store the cdids for the cds a registered user clicks on in a cdsbrowsed database table.
I have started these sessions on previous pages.
$ valid_user = $email;
session_register("valid_user");
$valid_user2 = $customerid;
session_register("valid_user2";
Here is my code for storing cdids in cdsbrowsed for registered customers:
if (session_is_registered("valid_user2")){
//Query the database to check not repeat cd browsed for that customer id
$query= "select count(*), cdid from cdsbrowsed
where customerid='$valid_user2'
and cdid= ".$HTTP_GET_VARS['cdid'];
$result = mysql_query($query);
if(!$result)
{
echo 'Cannot run query.';
exit;
At the moment it prints Cannot run query.
Can anyone see any problems with the query?