hey
okay i have a games script which i am re-vamping and i want to be able to control all the messages shown to the user through the databse so i been doing through all the scripts and on my way been replacing the comments and stuff with my function
get_msg(ID)
and i then have my database with the messgae:
You beat {$r['username']}!!<br />
for example and my function gets it from the db
My Function:
PHP Code:
function get_msg($id) { global $db, $r; $txt_res = $db->query("SELECT * FROM msg_texts WHERE text_id='$id'"); $txt_info = $db->fetch_row($txt_res); return $txt_info['text']; }
but i just noticed that the PHP in the messages aint being parsed.
do what am i doing wrong?
i thought adding $r to the globals would fix but obviouslt not...
Thanks TP for working answer.
__________________
Personal UK Webhosting Get 25% of ANY shared package for life ~ Promo: webmaster-talk (only for members!)
|