Maybe you can help me out with some SQLing. I'm trying to set up something similar to the hits table, but instead store referrer info.
I think I can handle the PHP, but I still get lost with the SQL side.
Creating the table to store the strings of referrers.
It's pretty easy with phpMyAdmin. You just need an id column, another numeric column for the redirect ID, then a varchar for the string.
(or text if you want to store things longer than 255 characters)
Would I put this in the r_redirects table?
there any reason why it couldn't be in the r_redirects?
Are you trying to log all of the referrals? You can do that if you want to serialize an array or something.
Perhaps not all of the referrals? Like, 10 or so. And...What does the rest mean...
Serializing an array turns it into a string, which you can then store in a database. Pretty handy.
us.php.net/serialize
What error, and with which query?
Have it print the entire query... I want to see what the error is.
(since that error report doesn't say a whole lot)
Okay, I think I did it. but nothing shows up on the page. Its error number 1604, if that helps at all
In class.SQL.php, add $query somewhere in line 33 or 34.
blockquote>".$query."</blockquote> I put this in the query function, but nothing shows up.
Can you pastie me the file?
Or do you want the misc.Sql thing
Pastie me the contents of class.SQL.php (with the $query addition)
Err, that should be class.SQL.txt, but whatever.
Looks like 'referrers' isn't being set (and you should definitely have it in quotes)
Can I see the refer() function?
It should be in the pastie above
I think I might have renamed it a few times, but I don't think thats the problem
No, that's just calling the function. I want to see the function itself.
Okay, No more SQL error, but it doesn't look like its storing any info...Hopefully I'll get this tomorrow.
I modified the code by adding ' around the referrer, and I got rid of the serialize for now.
pastie.org/232403
Gahah! It works! Now to figure out the serialize thingie.
Only serialize if you're putting an array in there.
You can probably just separate them with a string... serialization is more-so intended for nested arrays.
Nope, it definitely doesn't
What error does it produce?
Whoops, thats my fault. Was returning refer rather than referrers.
Now it is displaying a very wierd URL. I'm guessing thats cause of serialize? ½.WS/a?p