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

  • Home
  • SEARCH
  • 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 6022785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:54:31+00:00 2026-05-23T03:54:31+00:00

ColumnOne ColumnTwo ColumnThree Columnfour Columnfive ColumnSix one two three four 0 ‘Button Here’ As

  • 0

ColumnOne   ColumnTwo   ColumnThree Columnfour  Columnfive    ColumnSix
one           two          three       four        0        'Button Here'

As you can see above, I have six columns, five of which contain some sort of text, and the sixth column is to contain a button. My end goal is to have column six contain three buttons just like this image HERE shows. These buttons will allow me to edit, delete, and possibly one other function.

For now, though, I am just curious as to how I can make a button appear in the last column using my code below:

<?php

// Create variables to retrieve the POST data

$ID= $_POST['Input1'];
$Email= $_POST['Input2'];
$Name= $_POST['Input3'];
$Company= $_POST['Input4'];
$Price= $_POST['Input5'];

// Connect to the database

mysql_connect ("localhost","Username","Password") or die ('Error: ' . mysql_error());

echo "connected to database!";

mysql_select_db ("Database");

// Insert data into table

$query = "INSERT INTO CustomerInformation (ID, Email,Name,Company,Price,Tab Count,Action) VALUES(
'NULL', '".$ID."', '".$Email."', '".$Name."', '".$Company."', '".$Price."', "Form input type = "button" (something like this!) )";

// Above is my best attempt... I'm sure it's nowhere close (sorry!).

mysql_query($query) or die ('Error updating database');

echo "Database updated successfully!";

?>
  • 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-05-23T03:54:32+00:00Added an answer on May 23, 2026 at 3:54 am

    Change your code into this to make it secure and functional:

    <?php
    // Connect to the database
    
    mysql_connect ("localhost","Username","Password") 
      or die ('Error: ' . mysql_error());
    
    echo "connected to database!";
    
    mysql_select_db ("Database");
    
    // Insert data into table
    
    $Email= mysql_real_escape_string($_POST['Input2']);
    $Name= mysql_real_escape_string($_POST['Input3']);
    $Company= mysql_real_escape_string($_POST['Input4']);
    $Price= mysql_real_escape_string($_POST['Input5']);
    
    $action = mysql_real_escape_string('insert php code for button here');
    
    $query = "INSERT INTO CustomerInformation 
             (Email,Name,Company,Price,Tab Count,Action) 
             VALUES
             ('$Email', '$Name', '$Company', '$Price', '$action') ";
    mysql_query($query) or die ('Error updating database');
    
    echo "Database updated successfully!";
    
    ?>
    

    Note that you don’t need to insert an id into the table. If you have an autoincrement field id than MySQL will autocreate an id for you.
    mysql_real_escape_string() escapes values for you. Always surround your $var in the query with ' single quotes or mysql_real_escape_string() will not work!
    And never use it for column/table or database names, only for values.

    See: these questions for more info:

    SQL injection in general: How does the SQL injection from the "Bobby Tables" XKCD comic work?
    protecting against SQL injection when using dynamic table names: How to prevent SQL injection with dynamic tablenames?

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

Sidebar

Related Questions

Possible Duplicate: is this possible to made two primary key in one table Is
I have two sets of of input fields like this, differentiated by their classes:
Let's say that I want to find the number of words in each row
I create a table in database using sqlalchemy and now want to make a

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.