frisiandi Posted March 24, 2009 Share Posted March 24, 2009 Please help,I have this code :<form name="form1" method="post" action=""> <p> <input name="Add" type="button" onClick="MM_displayStatusMsg('Add Record');return document.MM_returnValue" value="Add"> <input name="Edit" type="button" onClick="MM_displayStatusMsg('Edit Record');return document.MM_returnValue" value="Edit"> <input type="button" name="Delete" value="Delete"> <input name="Save" type="submit" value="Save"> <input name="Cancel" type="button" value="Cancel"> <input type="button" name="Find" value="Find"> <input name="Browse" type="button" onClick="MM_goToURL('parent','datasales.php');return document.MM_returnValue" value="Browse"> <input name="Exit" type="button" onClick="MM_goToURL('parent','fprmenuphp.php');return document.MM_returnValue" value="Exit"> </p></form><?if(isset($_POST['Save'])) {mysql_connect ('server08', 'root', '');mysql_select_db ('accsys'); $result = mysql_query("INSERT INTO mastersales (kodesales,namasales,quota) VALUES('$_POST[kode]','$_POST[nama]','$_POST[quota]')"); ;}?> <table width="837" border="1" cellspacing="2" cellpadding="2"> <!--DWLayoutTable--> <tr> <td width="180" height="28" valign="top">NIK </td> <td width="550"><input name="id" type="text"> </td> </tr> <tr> <td width="180" height="28" valign="top">Kode Sales </td> <td><input name="kode" type="text" maxlength="4"> </td> </tr> <tr> <td width="180" height="28" valign="top">Nama Sales </td> <td><input name="nama" type="text" id="nama" size="50" maxlength="30"> </td> </tr> <tr> <td width="180" height="28" valign="top">Quota </td> <td><input name="quota" type="text" id="quota" size="30"> </td> </tr> <tr> <td width="180" height="25"> </td> <td> </td> </tr></table>It adds a blank record in database, why ? Link to comment Share on other sites More sharing options...
Synook Posted March 24, 2009 Share Posted March 24, 2009 Because the "kode", "nama" und "quota" fields aren't actually inside the form? Link to comment Share on other sites More sharing options...
frisiandi Posted March 24, 2009 Author Share Posted March 24, 2009 Because the "kode", "nama" und "quota" fields aren't actually inside the form?Do you mean i have to write the code in table area inside form area ? Link to comment Share on other sites More sharing options...
frisiandi Posted March 24, 2009 Author Share Posted March 24, 2009 Synook, Thanks a lot.... it works now Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.