Llight Posted February 18, 2013 Share Posted February 18, 2013 i get this when trying to add a new property Query was INSERT INTO houses VALUES(NULL, 'Shard', '900000000', '20000', '') Quote Link to comment Share on other sites More sharing options...
Dave Posted February 18, 2013 Share Posted February 18, 2013 What's the error? You've just posted the query that was trying to run. Quote Link to comment Share on other sites More sharing options...
Sam Fisher Posted February 18, 2013 Share Posted February 18, 2013 maybe you are missing a field in the query Quote Link to comment Share on other sites More sharing options...
Llight Posted February 18, 2013 Author Share Posted February 18, 2013 i don't think it gives an exact error this is just the message i get QUERY ERROR: Query was INSERT INTO houses VALUES(NULL, 'Shard', '900000000', '20000', '') Quote Link to comment Share on other sites More sharing options...
Djkanna Posted February 18, 2013 Share Posted February 18, 2013 i don't think it gives an exact error this is just the message i get QUERY ERROR: Query was INSERT INTO houses VALUES(NULL, 'Shard', '900000000', '20000', '') Can you paste the significant portion of the add_houses.php (or similar) here for us please. (use PHP tags [.PHP][./PHP] without the period (.)) Quote Link to comment Share on other sites More sharing options...
AnonymousUser Posted February 18, 2013 Share Posted February 18, 2013 i would suggest also adding the full table of your 'houses' could be your leaving something out in the query, or another way around it would be to simply insert the query/row yourself Quote Link to comment Share on other sites More sharing options...
AnonymousUser Posted February 18, 2013 Share Posted February 18, 2013 i would suggest also adding the full table of your 'houses' could be your leaving something out in the query, or another way around it would be to simply insert the query/row yourself Quote Link to comment Share on other sites More sharing options...
Llight Posted February 19, 2013 Author Share Posted February 19, 2013 Can you paste the significant portion of the add_houses.php (or similar) here for us please. (use PHP tags [.PHP][./PHP] without the period (.)) <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains shop stuffs switch($_GET['action']) { case "addhouse": addhouse(); break; case "edithouse": edithouse(); break; case "delhouse": delhouse(); break; default: print "Error: This script requires an action."; break; } function addhouse() { global $db, $ir, $c, $h, $userid; $price=abs((int) $_POST['price']); $will=abs((int) $_POST['will']); $name=$_POST['name']; $hsepic=$_POST['hsepic']; if($price and $will and $name) { $q=$db->query("SELECT * FROM houses WHERE hWILL={$will}"); if($db->num_rows($q)) { print "Sorry, you cannot have two houses with the same maximum will."; $h->endpage(); exit; } $db->query("INSERT INTO houses VALUES(NULL, '$name', '$price', '$will', '$hsepic')"); print "House {$name} added to the game."; stafflog_add("Created House $name"); } else { print " <div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> Add House</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'><br> <br><br> <form action='staff_houses.php?action=addhouse' method='post'> Name: <input type='text' name='name' /><br /> Price: <input type='text' name='price' /><br /> Max Will: <input type='text' name='will' /><br /><br /><br /> <b>House Pic URL</b><br /> <input type='text' name='hsepic' /><hr /> <input type='submit' value='Add House' /></form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } } function edithouse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $price=abs((int) $_POST['price']); $will=abs((int) $_POST['will']); $q=$db->query("SELECT * FROM houses WHERE hWILL={$will} AND hID!={$_POST['id']}"); if($db->num_rows($q)) { print "Sorry, you cannot have two houses with the same maximum will."; $h->endpage(); exit; } $name=$_POST['name']; $hsepic=$_POST['hsepic']; $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['id']}"); $old=$db->fetch_row($q); if($old['hWILL'] == 100 && $old['hWILL'] != $will) { die("Sorry, this house's will bar cannot be edited."); } $db->query("UPDATE houses SET hWILL=$will, hPRICE=$price, hNAME='$name', hPic='$hsepic' WHERE hID={$_POST['id']}"); $db->query("UPDATE users SET maxwill=$will WHERE maxwill={$old['hWILL']}"); $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); print "House $name was edited successfully."; stafflog_add("Edited house $name"); break; case "1": $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['house']}"); $old=$db->fetch_row($q); print " <div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> Editing a House</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'><br> <br><br> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['house']}' /> Name: <input type='text' name='name' value='{$old['hNAME']}' /> Price: <input type='text' name='price' value='{$old['hPRICE']}' /><br /> Max Will: <input type='text' name='will' value='{$old['hWILL']}' /><br /> <b>House Pic URL</b><br /> <input type='text' name='hsepic' value='{$old['hPIC']}' /><hr /> <input type='submit' value='Edit House' /></form> </div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div> "; break; default: print " <div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> Editing a House</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'><br> <br><br> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='1' /> House: ".house_dropdown($c, "house")."<br /> <input type='submit' value='Edit House' /></form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; break; } } function delhouse() { global $db,$ir,$c,$h,$userid; if($_POST['house']) { $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['house']}"); $old=$db->fetch_row($q); if($old['hWILL']==100) { die("This house cannot be deleted."); } $q2=$db->query("SELECT * FROM users WHERE maxwill={$old['hWILL']}"); $ids=array(); while($r=$db->fetch_row($q2)) { $ids[]=$r['userid']; } if(count($ids)) { $db->query("UPDATE users SET money=money+{$old['hPRICE']}, maxwill=100 WHERE userid IN(".implode(', ', $ids).")"); } $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); $db->query("DELETE FROM houses WHERE hID={$old['hID']}"); print "House {$old['hNAME']} deleted."; stafflog_add("Deleted house {$old['hNAME']}"); } else { print " <div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> Delete House </h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'><br> <br><br> Deleting a house is permanent - be sure. Any users that are currently on the house you delete will be returned to the first house, and their money will be refunded.<form action='staff_houses.php?action=delhouse' method='post'> House: ".house_dropdown($c, "house")."<br /> <input type='submit' value='Delete House' /></form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted!<br /> <a href='staff_users.php?action=reportsview'>> Back</a>"; } $h->endpage(); ?> Quote Link to comment Share on other sites More sharing options...
Llight Posted February 20, 2013 Author Share Posted February 20, 2013 No one know? Quote Link to comment Share on other sites More sharing options...
Scorpio Posted February 20, 2013 Share Posted February 20, 2013 I see, you have the raven mafia script. Quote Link to comment Share on other sites More sharing options...
Llight Posted February 20, 2013 Author Share Posted February 20, 2013 Yes that it correct, i use 2 scripts on 2 different sites 1 runs ravens script the other mccodes V2 Quote Link to comment Share on other sites More sharing options...
Scorpio Posted February 20, 2013 Share Posted February 20, 2013 Well you will need a license for it. Quote Link to comment Share on other sites More sharing options...
Llight Posted February 20, 2013 Author Share Posted February 20, 2013 for what? i have licenses for both i paid for them Quote Link to comment Share on other sites More sharing options...
Newbie Posted February 20, 2013 Share Posted February 20, 2013 i think he means you need 2 mccodes v2 licenses if you paid for ravens script off his site doesn't really count as its a mccodes engine v2 with a different layout which i have seen people say is stolen too Quote Link to comment Share on other sites More sharing options...
Llight Posted February 20, 2013 Author Share Posted February 20, 2013 Well in that case raven scripts are scamming people thanks for letting me know I knew it had mccode source code in it as you can see in some of the scripts but I didn't know they they was not supposed to be selling it Quote Link to comment Share on other sites More sharing options...
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.