Jump to content

aavik

New Members
  • Posts

    2
  • Joined

  • Last visited

aavik's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. THIS IS MY FULL CODE .. EVERY VALUE TYPE IN THE FORM GET STROE BUT. <select name="select" id="select"> <option selected="selected" value="MALE">Male</option> <option selected="" value="FEMAIL">FEMAIL</option> </select> MALE or FEMAIL DOESN'T GET STORED in DATABASE. In DATABASE :- cktext table attribute "section" is varchar type. <form id="form1" name="form1" method="post" action="add.php"> <table width="958" height="372"> <tr> <td width="69">Name:</td> <td width="608"><input name="textfield" type="text" id="textfield" size="40" /></td> </tr> <tr> <td width="69">Email:</td> <td width="608"><input name="te" type="text" id="te" size="40" /></td> </tr> <tr> <td>Section:</td> <td><select name="select" id="select"> <option selected="selected" value="MALE">Male</option> <option selected="" value="FEMAIL">FEMAIL</option> </select></td> </tr> <tr> <td>Subject:</td> <td><select name="select2" id="select2"> <option selected="selected" value="MA">Ma</option> <option selected="" value="FE">FE</option> </select></td> </tr> <tr> <td height="53">Description</td> <td><textarea name="textarea" id="textarea" cols="45" rows="3"></textarea></td> </tr> <tr> <td>Upload</td> <td> <label for="fileField"></label> <input name="fileField" type="file" id="fileField" size="40" /> </td> </tr> <tr> <td> </td> <td> <input type="submit" name="button2" id="button2" value="Upload" /> </td> </tr> </table> </form>
  2. mysql.php <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("ckeditor",$con); ?> --------------------------------------------------------- add.php <?php include("mysql.php"); if(isset($_POST["button2"])) { $sql="INSERT INTO cktext (section) VALUES ('$_POST[select2]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } ?> ----------------------------------------------------------------- home.php <form id="form1" name="form1" method="post" action="add.php"> <tr> <td>Section:</td> <td><select name="select2" id="select2"> <option selected="selected" value="MALE">Male</option> <option selected="" value="FEMAIL">FEMAIL</option> </select></td> </tr> <input type="submit" name="button2" id="button2" value="Upload" /> </form> In DATABASE :- cktext table attribute "section" is varchar type. BUT IT RETURN ME BLANK OUTPUT.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.