ishmell Posted April 28, 2009 Posted April 28, 2009 Im trying to make a mod of mine put someone in jail after failing something. But the fallowing code below doesn't seem to be working. Could anyone tell me why? and provide a fix for it... $jailreason= ('Reason Here'); $db->query("UPDATE users SET jail_reason=$jailreason WHERE userid=$userid"); Quote
ShizzleNizzle Posted April 28, 2009 Posted April 28, 2009 Re: Jail_Reason $jailreason= ('Reason Here'); $db->query("UPDATE users SET jail_reason='$jailreason' WHERE userid=$userid"); That will work, just missing some ''...easy mistake lol Quote
Floydian Posted April 28, 2009 Posted April 28, 2009 Re: Jail_Reason * PHP-Games > * Webdev and programming (Non Game related) > * PHP/MySQL > * PHP Databases > * Post reply ( Re: Jail_Reason ) Just in case ya didn't notice what forum this was ;) Quote
Spudinski Posted April 28, 2009 Posted April 28, 2009 Re: Jail_Reason Luckily Floydian saved me time in saying that, but seriously... post in the correct sections please, it saves us all allot of time that we could have spent doing much more useful things. **Topic Moved** Quote
Karlos Posted April 28, 2009 Posted April 28, 2009 Re: Jail_Reason Or... $JailReason = 'Some Reason...'; $db->query(sprintf("UPDATE users SET jail_reason=%s WHERE userid=%d", addslashes($JailReason), $userid)); Quote
mmomaker Posted April 28, 2009 Posted April 28, 2009 Re: Jail_Reason is this for mccodes? or for a different engine Quote
Karlos Posted April 28, 2009 Posted April 28, 2009 Re: Jail_Reason Well the query he gave, and the Board this is in... I'm guessing MC Codes.. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.