Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2005
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need help entering data in to db

    here is ma script it just wont add it to my db can somone tell me what am doing wrong

    PHP Code:
    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!"

  • #2
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    is that the whole code, if it is your missing the end of your function.

  • #3
    New Coder
    Join Date
    Jul 2005
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thats some more of script more form bottem of it cant add hold script too many charecters lool
    PHP Code:
    }
    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 /> 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •