Okay, let me try and explain this in under one million words?!
I have a PHP script which logs whenever someone visits a Member's Profile.
The visitor_log table looks like this...
id (UK) AutoIncrement
And my member table looks like this...
id (PK) AutoIncrement, MediumInt, Unsigned
Here is the problem...
If a Non-Member (i.e. No MemberID) visits a Member's Profile, I still want/need something to stick in "visitor_id".
Originally I was going to stick a NULL in there, but then I realized that won't work since it part of my Composite Primary Key.
So then I decided to just insert a "0" in there.
Problem is that then I would have to create a "dummy" Member profile for Anonymous Visitors. (Think "Referential Integrity"!!)
Also, since the field is MEDIUMINT UNSIGNED, I can't use "0"?!
And I don't want to change the Data-Type for several reasons.
I *really* wanted to insert a NULL or "0" in there to make Anonymous Visitors stand out, but I don't see an easy way to do this...
Should I break down, create a "dummy" Member record with a "1" as the MemberID and use that whenever an Anonymous Visitor needs to be logged?
There must be a better way to go about all of this...