gurpreet Posted January 1, 2009 Posted January 1, 2009 OK so I have just added jailreason, jail_reason and some others to my mysql DB and my jail reason is still wrong. When I fail the crime it says "0" and the jail reason is "0" without the "s. docrime.php: <?php $macropage="docrime.php?c={$_GET['c']}"; include "globals.php"; if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); } $_GET['c']=abs((int) $_GET['c']); if(!$_GET['c']) { print "Invalid crime"; } else { $q=mysql_query("SELECT * FROM crimes WHERE crimeID={$_GET['c']}",$c); $r=mysql_fetch_array($q); if($ir['brave'] < $r['crimeBRAVE']) { print "You do not have enough Brave to perform this crime."; } else { $ec="\$sucrate=".str_replace(array("LEVEL","CRIMEXP","EXP","WILL","IQ"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ']),$r['crimePERCFORM']).";"; eval($ec); print $r['crimeITEXT']; $ir['brave']-=$r['crimeBRAVE']; mysql_query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c); if(rand(1,100) <= $sucrate) { print str_replace("{money}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT']); $ir['money']+=$r['crimeSUCCESSMUNY']; $ir['crystals']+=$r['crimeSUCCESSCRYS']; $ir['exp']+=(int) ($r['crimeSUCCESSMUNY']/8); mysql_query("UPDATE users SET money={$ir['money']}, crystals={$ir['crystals']}, exp={$ir['exp']},crimexp=crimexp+{$r['crimeXP']},crimes=crimes+1 WHERE userid=$userid",$c); mysql_query("UPDATE users SET cincome=cincome+{$r['crimeSUCCESSMUNY']} WHERE userid=$userid",$c); if($r['crimeSUCCESSITEM']) { item_add($userid, $r['crimeSUCCESSITEM'], 1); } } else { if(rand(1, 2) == 1) { print $r['crimeFTEXT']; } else { print $r['crimeJTEXT']; $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'"); } } print " [url='docrime.php?c={$_GET[']Try Again[/url] [url='criminal.php']Crimes[/url]"; } } $h->endpage(); ?> If any other files are needed, just say so and I'll paste them. Quote
AlabamaHit Posted January 1, 2009 Posted January 1, 2009 Re: Jail reason/Crime fail? in your database what did you make the file jail_resaon? You didnt make it INT by chance did you? Quote
gurpreet Posted January 1, 2009 Author Posted January 1, 2009 Re: Jail reason/Crime fail? I made it varchar(255) I did a sql query not a file. Quote
AlabamaHit Posted January 1, 2009 Posted January 1, 2009 Re: Jail reason/Crime fail? you didnt set the default to 0 did you? default should be blank.. Quote
gurpreet Posted January 1, 2009 Author Posted January 1, 2009 Re: Jail reason/Crime fail? default (blank), varchar 255, not null Quote
gurpreet Posted January 1, 2009 Author Posted January 1, 2009 Re: Jail reason/Crime fail? Here's what my bro sent me of what it looks like Name: Id: Level: Time: Reason (0) |< @ ? H ! [2] 5 2 minutes 0 [bust][bail] Quote
AlabamaHit Posted January 1, 2009 Posted January 1, 2009 Re: Jail reason/Crime fail? the code from a glance looks right....only other i can think of cause its late...check the database make sure that the jREASON in the database is there and not blank..like for the crime...maek sure the text to input there is right....crap i know im not explaining this good.. like when you made the crime make sure it updated the database right....so that there is text to put in. Quote
gurpreet Posted January 1, 2009 Author Posted January 1, 2009 Re: Jail reason/Crime fail? I got it..Bad problem. Inserted rows: 1 Warning: #1265 Data truncated for column 'crimeJTEXT' at row 1 Warning: #1265 Data truncated for column 'crimeJREASON' at row 1 For some reason when I do anything to do with those 2 columns, it auto truncates after i click go...Any ideas how to fix it? Quote
gurpreet Posted January 2, 2009 Author Posted January 2, 2009 Re: Jail reason/Crime fail? Bump! it auto truncates..Any ways to fix this? 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.