In my DB (mysql) I have a table 'ads' which contains info about different ads on a website.
I want to track unique clicks on any ad.
So I created a field 'item_discount_userid
' (mediumtext
) in table ads and want to store users IDs comma separated in that field (like '1,13,44,22,45')
And on click I want to check is user ID is already in that list or not.
If not I want to add user ID to that list and send him mail. Else - do nothing.
Can some one help me with PHP code (7.3 php)?
To be short I want something like this:
if 'user_id' is in 'item_discount_userid'
{
}
else
{
add user_id in 'item_discount_userid';
}
Sorry for my poor English, and I am a newbee in PHP. Tried searching, tried some answers but failed. Thanks ahead!