...

View Full Version : need help entering data in to db



sytodave88
08-26-2007, 04:11 PM
here is ma script it just wont add it to my db can somone tell me what am doing wrong


function new_crime_form()
{
global $ir, $c;
print " Adding a new crime.<br />
((WILL*0.8)/1)+(LEVEL/4) Remember. <br />
<form action='admin.php?action=newcrimesub' method='post'>
Crime Name: <input id='crimename' type='text' name='crimename'/><br />
Crime Brave: <input id='crimebrave' type='text' name='crimebrave' /><br/>
Crime Percent Forum : <input id='crimeper' type='text' name='crimeper'/><br />
Crime Money: <input id='crimemoney' type='text' name='crimemoney' /><br/>
Crime Group: <select id='crimegroup' name='crimegroup' type='dropdown'><option>1</option><option>2</option></select><br />
Crime Text: <input id='crimetext' type='text' name='crimetext'/><br />
Crime S Txt: <input id='crimestxt' type='text' name='crimestxt'/><br />
Crime f Txts: <input id='crimeftxt' type='text' name='crimeftxt'/><br />
Crime EXP: <input id='crimeexp' type='text' name='crimeexp'/><br />
<br />
<input type='submit' value='Create Crime' /></form> ";
}
function new_crime_submit()
{
global $ir,$c;
if(!isset($_POST['crimename']))
{
print "You missed one or more of the required fields. Please go back and try again.<br />
<a href='admin.php?action=newcrime'>&gt; Back</a>";
$h->endpage();
exit;
}


mysql_query("INSERT INTO `crimes` ( `crimeID` , `crimeNAME` , `crimeBRAVE` , `crimePERCFORM` , `crimeSUCCESSMUNY` , `crimeGROUP` , `crimeITEXT` , `crimeSTEXT` , `crimeFTEXT` , `crimeEXP` )
VALUES (
'', '{$_POST['crimename']}', '{$_POST['crimebrave']}', '{$_POST['crimeper']}', '{$_POST['crimemoney']}', '{$_POST['crimegroup']}', '{$_POST['crimetext']}', '{$_POST['crimestxt']}', '{$_POST['crimeftxt']}', '{$_POST['crimeexp']}'
");
print "Crime created!";

rafiki
08-26-2007, 04:35 PM
is that the whole code, if it is your missing the end of your function.

sytodave88
08-26-2007, 05:30 PM
thats some more of script more form bottem of it cant add hold script too many charecters lool

}
function new_crime_form()
{
global $ir, $c;
print " Adding a new crime.<br />
((WILL*0.8)/1)+(LEVEL/4) Remember. <br />
<form action='admin.php?action=newcrimesub' method='post'>
Crime Name: <input id='crimename' type='text' name='crimename'/><br />
Crime Brave: <input id='crimebrave' type='text' name='crimebrave' /><br/>
Crime Percent Forum : <input id='crimeper' type='text' name='crimeper'/><br />
Crime Money: <input id='crimemoney' type='text' name='crimemoney' /><br/>
Crime Group: <select id='crimegroup' name='crimegroup' type='dropdown'><option>1</option><option>2</option></select><br />
Crime Text: <input id='crimetext' type='text' name='crimetext'/><br />
Crime S Txt: <input id='crimestxt' type='text' name='crimestxt'/><br />
Crime f Txts: <input id='crimeftxt' type='text' name='crimeftxt'/><br />
Crime EXP: <input id='crimeexp' type='text' name='crimeexp'/><br />
<br />
<input type='submit' value='Create Crime' /></form> ";
}
function new_crime_submit()
{
global $ir,$c;
if(!isset($_POST['crimename']))
{
print "You missed one or more of the required fields. Please go back and try again.<br />
<a href='admin.php?action=newcrime'>&gt; Back</a>";
$h->endpage();
exit;
}


mysql_query("INSERT INTO `crimes` ( `crimeID` , `crimeNAME` , `crimeBRAVE` , `crimePERCFORM` , `crimeSUCCESSMUNY` , `crimeGROUP` , `crimeITEXT` , `crimeSTEXT` , `crimeFTEXT` , `crimeEXP` )
VALUES (
'', '{$_POST['crimename']}', '{$_POST['crimebrave']}', '{$_POST['crimeper']}', '{$_POST['crimemoney']}', '{$_POST['crimegroup']}', '{$_POST['crimetext']}', '{$_POST['crimestxt']}', '{$_POST['crimeftxt']}', '{$_POST['crimeexp']}'
");
print "Crime created!";
}
function new_user_form()
{
global $ir, $c;
print "Adding a new user.<br />



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum