Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9140079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:28:09+00:00 2026-06-17T09:28:09+00:00

I have created a simple web form in which you input data into and

  • 0

I have created a simple web form in which you input data into and then it is posted into the database, when submitting the information it is submitted correctly but when I view it in the table the data is invisible.

query

CREATE TABLE `recipe` (
    `id` int(4) NOT NULL auto_increment,
    `recipename` varchar(65) NOT NULL default '',
    `ingredients` varchar(65) NOT NULL default '',
    `instructions` varchar(65) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=0 ; 

php code

<?php

$host="localhost"; // Host name
$username="my username"; // Left empty due to privacy
$password="mypassword"; // Left empty due to privacy
$db_name="mydatabase"; // Left empty due to privacy
$tbl_name="recipe"; // Table name


mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");


$recipe=$_POST['recipename'];
$ingredients=$_POST['ingredients'];
$instructions=$_POST['instructions'];


$sql="INSERT INTO $tbl_name(recipename, ingredients, instructions)VALUES('$recipe', '$ingredients', '$instructions')";
$result=mysql_query($sql);


if($result){
    echo "Successful";
    echo "<BR>";
    echo "<a href='recipe.php'>Back to main page</a>";
} else {
   echo "ERROR";
}
?>

<?php
// close connection
mysql_close();
?> 

Web Form

<table width="300" border="0" align="center" cellpadding="0" cellspacing="1">
  <tr>
    <td>
      <form name="form1" method="post" action="insert_ac.php">
        <table width="100%" border="0" cellspacing="1" cellpadding="3">
          <tr>
            <td colspan="3"><strong>Insert Data Into mySQL Database </strong></td>
          </tr>
          <tr>
            <td width="71">Recipe name</td>
            <td width="6">:</td>
            <td width="301"><input name="name" type="text" id="recipe"></td>
          </tr>
          <tr>
            <td>Ingredients</td>
            <td>:</td>
            <td><input name="lastname" type="text" id="ingredients"></td>
          </tr>
          <tr>
            <td>Instructions</td>
            <td>:</td>
            <td><input name="email" type="text" id="instructions"></td>
          </tr>
          <tr>
            <td colspan="3" align="center"><input type="submit" name="Submit" value="Submit"></td>
          </tr>
        </table>
      </form>
    </td>
  </tr>
</table>

I would love to know if anyone knows the reason the data is invisible.enter image description here

Image of table with no data

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:28:10+00:00Added an answer on June 17, 2026 at 9:28 am
    $recipe=$_POST['recipename'];
    $ingredients=$_POST['ingredients'];
    $instructions=$_POST['instructions'];
    

    needs to be:

    $recipe=$_POST['name'];
    $ingredients=$_POST['lastname'];
    $instructions=$_POST['email'];
    

    You have the form field names wrong, so it is not getting a value and thus inserting empty data. If you set error_reporting to E_ALL you would have gotten an error. Make sure you develop with it at that setting.

    Also the name attribute in the form field is what the index name would be for $_POST['INDEX_NAME'], you are mistakingly using the id attribute for that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple web form on ASP.NET which includes a DropDownList with
I have created a simple web app/form using google app engine. the site is
I am writing a SharePoint web part which will have a simple ASP.NET form.
I have a simple web application in which I have created a wizard, each
I have an ASP.NET web form on which I'm displaying a list of database
Could someone help me on this, I have created simple web services using axis2
I have created the simple web service. Code: [ServiceContract] public interface ITsdxService { [OperationContract]
I have created a simple web browser using c# and I want to block
I have created a simple web-service using Java. i want to load jars related
What I have created a very simple asp.net web service using .NET framework 3.5,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.