Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


vamsi
php
0 Answer(s)      11 months ago
Posted in : PHP


im beginner to php. i faced problem with creating form and data stored into mysql


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 
Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<title>Form Input Data</title>
</head>

<body>
<table border="1">
  <tr>
    <td align="center">Form Input Employees Data</td>
  </tr>
  <tr>
    <td>
      <table>
        <form method="post" action="input.php">
        <tr>
          <td>Name</td>
          <td><input type="text" name="name" size="20">
          </td>
        </tr>
        <tr>
          <td>User name</td>
          <td><input type="text" name="username" size="20">
          </td>
        </tr>
        <tr>
          <td>Password</td>
          <td><input type="Password" name="pwd" size="20">
          </td>
        </tr>
         <tr>
          <td>Email</td>
          <td><input type="text" name="email" size="20">
          </td>
        </tr>
          <td></td>
          <td align="right"><input type="submit" 
          name="submit" value="Register"></td>
        </tr>
        </table>
      </td>
    </tr>
</table>
</body>
</html>


i have created table in mysql 
create table data_employees(name char(20),username char(20),pwd char(20),email char(20),PRIMARY KEY(username));

<?
//the example of inserting data with variable from HTML form
//input.php
mysqli_connect("localhost","root","","test");

//inserting data order
$order = "INSERT INTO data_employees
            (name,username,pwd,email)
            VALUES
            ('$name',
            '$username'.'$pwd','$email')";

//declare in the order variable
$result = mysql_query($order);    //order executes
if($result){
    echo("<br>Input data is succeed");
} else{
    echo("<br>Input data is fail");
}
?>


but the out put will displayed like this and dosnt insert the data into table

      Input data is succeed");
          Input data is fail");?>

Advertisement
View Answers

Related Tutorials/Questions & Answers:
php
php   what is php   PHP Tutorials
php
php  what is php
Advertisements
php
php using javasript  how to set timer in php using javasript
php
php  i want to know about php and php plateform required software to make php program and database that used in php program?   Please visit the following link: PHP database
php
php  i want to know about php and php plateform required software to make php program and database that used in php program?   Please visit the following link: PHP database
php
php  show the constructor overloading in php
PHP
PHP  How to work in drupal with PHP
PHP
PHP   hii, Define PHP?   Hello, The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web
php
php  what is php   PHP is one of the most used open source server-side scripting language, which runs on almost all the platform. PHP... and Solaris. To know more about PHP, Visit Here
php
php  how to write a program in php to create pdf file
php
php  plz tell me code for PHP SQL Insert,delete,update,view is used to insert the record from HTML page to Mysql database using in single PHP form
php
php  retrieve data from mysql in php   Please visit the following links: http://www.roseindia.net/sql/mysql-table/mysql-php-select.shtml http://www.roseindia.net/sql/mysql-example/select-where.shtml
php
php  How to catch a image and link click counters using Ajax php can any one help me
php
php  how to set email remainder in php?can you help me pls
PHP
PHP  I want to create Calendar Event in PHP. Could u help me
PHP
PHP  How to check whether a username exists on a website using php and cURL and not MySQL
php
Write a simple PHP program that display the days of week as per the system date using switch case statement.  Write a simple PHP program that display the days of week as per the system date using switch case statement
PHP
PHP  I would love to do PHP project with the title of "Hospital Management System". I want to know how to make validation using jquery
php
can learn php mysql connectivity examples from the given link: PHP Mysql Connectivity
php
shortcut method in php like in javscript seletedIndex
php
php  im beginner to php. i faced problem with creating form and data stored into mysql <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <
php
php  im beginner to php. i faced problem with creating form and data stored into mysql <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <
PHP Property Management - PHP
PHP Property Management  PHP Property Management.. any idea
rotate image in php - PHP
rotate image in php   Function to rotate image in PHP
php means
php means  php means
PHP duplicate file - PHP
PHP duplicate file   i wanted to duplicate a PHP file resides in different directory on submission
PHP MVC Framework - PHP
PHP MVC Framework   Which is the best & latest PHP MVC Framework... and where can i download it. Thanks
php generate link - PHP
php generate link  How can i generate links in PHP for my photo gallery app
php text encoding - PHP
php text encoding  How to encode the text editor text in PHP...how can it be done
$_get php example - PHP
$_get php example  Explain the $_get method in php with a simple example. m a beginner
php a href
php a href  How to use php a href to pass the value in PHP
Array length in PHP - PHP
Array length in PHP  a function to get the array length in PHP.  Hi Friend, Please visit the following link: http://www.roseindia.net/tutorial/php/phparray/php-array-length-for.html Thanks
Replace String in PHP - PHP
Replace String in PHP  What is the fastest way of replacing string in PHP Code?  Hi Friend, Please visit the following link: http://www.roseindia.net/tutorial/php/phpbasics/PHP-Array-Replace.html Thanks
Pagination in PHP code - PHP
Pagination in PHP code  3.Pagination in PHP codeIs it possible to get the paging in PHP without database call? How will I show the image instead of numbering? any code that can help
What's PHP ?
What's PHP ?  What's PHP
absolute path in php - PHP
absolute path in php  how to get absolute path in php
password encryption in php - PHP
password encryption in php  example of password encryption in php
What-is-PHP - PHP
What-is-PHP  Hi, I would like to know more about PHP. What PHP and how it is good for programming websites? Thanks Deepak   Hi, Read more about PHP at http://www.roseindia.net/php/ Thanks
fetch url in php - PHP
fetch url in php  How to Fetch URL in PHP
calendar in php code - PHP
calendar in php code   Any Idea to create a calendar for school in PHP? I need a simple nd handy code
php events manager - PHP
php events manager  I am looking for a design and structure for the php events manager. Is there any free app on internet that i can use
Imagemagick in PHP - PHP
Imagemagick in PHP   i faced the problem while implement imagemagick code in php. Can you please post a sample code
Static Method in PHP - PHP
Static Method in PHP  So far I can easily use the normal functions as variable in PHP? but how can use static method?  Hi Friend, Please visit the following link: http://www.roseindia.net/tutorial/php/phpoop/php
Multidimensional Array in PHP - PHP
in PHP completely goes over my head. Can any one present a better explanation on it with an example? Also the structure of Multidimensional Array in PHP. .../tutorial/php/phparray/arraymultidimension.html Thanks
php escape hyphen - PHP
php escape hyphen  Just confuse if a regular expression also escape the hyphen.. can any one help me to better understand the regular expression in PHP
why php and mysql - PHP
why php and mysql  I noticed in most of the application that developer always use mysql with PHP. Why they do so,, as there are money other database are too available
variable types in php - PHP
variable types in php  Do i need to explicitly specify the variable type in PHP
unit test in php - PHP
unit test in php  How can i run the unit test in PHP
php parse string as php
php parse string as php  Best way of parsing a string within a string
PHP Tax Calculator - PHP
PHP Tax Calculator  In my project i required a tax calculator that can calculate the property tax
Advertisements
 

 

 

DMCA.com