Page 1 of 1

Help - no values are being entered in to table

Posted: Fri Aug 05, 2011 4:47 pm
by dweil31
I can not get a the data to post to the db table i just can create rows and unique values can anyone help.

Code: Select all

<?php

  // Connect to database
     include_once "scripts/connect_to_mysql.php";


$sql = mysql_query("INSERT INTO membersa (username, password, firstname, lastname, bio_body, city, zip) 
       VALUES(/'$username/',/'$password/',/'$firstname/',/'$lastname/',/'$bio_body/',/'$city/',/'$zip/')") 
       or die (mysql_error());
 
      $id = mysql_insert_id();
	 
	 // Create directory(folder) to hold each user's files(pics, MP3s, etc.)		
     mkdir("members/$id", 0755);
     exit();
      
 ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<form action="regester.php" method="post" enctype="multipart/form-data">
  <p>
    <label>First Name
      <input type="text" name="firstname" id="firstname" class="formFields" size="32" maxlength="20" />
    </label>
  </p>
  <p>
    <label>Last Name
      <input type="text" name="lastname" id="lastname" class="formFields" size="32" maxlength="20" />
    </label>
  </p>
  <p>
    <label>Email
     <input name="email" type="text" class="formFields" id="email"  size="32" maxlength="48" />
    </label>
  </p>
  <p>
    <label>Bio
      <textarea name="bio_body" id="bio_body" cols="45" rows="5"class="formFields"  size="35" maxlength="255" /></textarea>
    </label>
  </p>
  <p>
    <label>City
      <input type="text" name="city" id="city" class="formFields"  size="32" maxlength="20" />
    </label>
  </p>
  <p>
    <label>Zip Code
      <input type="text" name="zip" id="zip" class="formField size="32" maxlength="20" />
    </label>
  </p>
  <p>
    <label>User Id
      <input type="text" name="username" id="username" class="formFields"  size="32" maxlength="20" />
    </label>
  </p>
  <p>
    <label>Password
      <input type="text" name="password" id="password" class="formFields"  size="32" maxlength="20" />
    </label>
  </p>
  <p>
    <label>
       <input type="submit" name="Submit" value="Sign Up!"  />
    </label>
  </p>
 
  <p>&nbsp;</p>
</form>
</body>
</HTML>

Re: Help - no values are being entered in to table

Posted: Sat Aug 06, 2011 1:35 pm
by McInfo

Re: Help - no values are being entered in to table

Posted: Sat Oct 08, 2011 5:42 am
by aliraza
pls give the variables as it is inside query , dont give /'/' ,around variable ,
hope this will insert that record,
normally if there is syntax error,mysql dont allow record to be inserted