'INSERT IGNORE INTO', how would I get the column which causes the ignore (the column which is set to 'unique'/'primary') ?
Example of usage, I insert users to the table and it wont insert if the username or email is already inserted - I want to know whether it was the email or username (or both) which is already inserted so I can print an error message on the screen via javascript.
Ofcause, you might suggest me to use SELECT beforehand. However, by doing this I'd have to run 2 additional queries - I'm trying to keep the script as clean / quick as possible.
I know mysql_affected_rows() can tell me if it's inserted or not, but it doesn't return the columns which provented it from doing so.
I assume I could use mysql_error or something? I'm not sure since mysql_error only shows on an error - since I use 'IGNORE' it wont buffer an error.
Would @mysql_query('INSERT INTO ...') work if I parsed mysql_error or something?