So...does it output "error connecting"? We'll probably need more info then... running on local? is mysql actually running? user properties set properly?...
If not then -> you don't have the database selected (mysql_select_db())...well, that's necessary anyway
----
Again - why you use sprintf without any arguments? This way it does nothing...
I'd also suggest better variable naming... instead of $CL rather $characterLevel or $character["level"] or something.... I'm not sure you'll be able to remember purpose of dosens of variables named like BXPM (I have no idea what does it mean

)
Echo $PXP won't output anything since mysql_query returns either boolean (true/false) or resource type (kinda collection, pack of data you got from DB)... for 1 column you can use mysql_result, for more columns take a look at mysql_fetch_array()
INSERT INTO xp(EXP) VALUE $XP_Lvlhas imho incorrect syntax
INSERT INTP xp (EXP) VALUES ($XP_Lvl)^
btw. it's better to write either camel case (someVariable) or underscore with all lower case (some_variable)...you versionis kinda more difficult to write