Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

database not inserting properly

Links for php scripts

Moderators: macek, egami, gesf

database not inserting properly

Postby sujskiez » Thu Jun 12, 2014 8:59 pm

So i have this html page with php code linked with .htaccess but when i try to insert some values from the form into the database. So when i try to indert into the database the values aren't going in but the only value that is going in are the numbers 1.
Can someone help me?? this is the code

Code: Select all

<script language="javaScript" src="myfile.php"></script>

     error_reporting(E_ALL ^ E_DEPRECATED);
     $con = mysql_connect("localhost","root","");
   if (!$con)
      die('Could not connect: ' . mysql_error());
    mysql_select_db("whatchadoin", $con);
   //$f = "Heelo";
   $last_name = isset($_POST['lname']);
   $email = isset($_POST["email"]);
   //$gender = $_POST['sel_gender'];
   if(isset($_POST['fname']) && isset($_REQUEST['submit']))
   $f_name = isset($_POST['fname']);
   $sql="INSERT INTO participant (fname, lname,email) VALUES

   if (!mysql_query($sql,$con))
     die('Error: ' . mysql_error());
   echo "1 record added";



<form  method='post' >
<input type="text" name="fname" id="fname" />
<input type="text" name="lname" id="lname" />
<input type="text" name="email" id="email" />

<input type="submit" name="submit" value="submit"/>

New php-forum User
New php-forum User
Posts: 1
Joined: Thu Jun 12, 2014 8:49 pm

Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.