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 9233725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:37:19+00:00 2026-06-18T06:37:19+00:00

I have a simple, unsecured, local database that I’m learning with (yes still using

  • 0

I have a simple, unsecured, local database that I’m learning with (yes still using MySQL for now) I can view my database rows in a table and click on an edit button which then displays the single record chosen with each column inside a text box to update and save.

This is part of my edit page which displays five text boxes that I’m attempting to update the db with

<?php
while ($row=mysql_fetch_array($result))
{
?>
<form action="updateinfo.php" method="post">
<tr>
  <td align="right">Partnumber:</td>
  <td align="left"><input type="text" name="partnumber" value="<?php echo $row['partnumber'];?>"/></td>
</tr> 

Here is my updateinfo

<?php
mysql_connect("localhost","name","password") or die("Error: ".mysql_error()); 
mysql_select_db("toner");

$partnumber  = $_POST['partnumber'];
$description = $_POST['description'];
$vendor      = $_POST['vendor'];
$price       = $_POST['price'];
$quantity    = $_POST['quantity'];
$sql         = "UPDATE inventory SET partnumber ='".$partnumber."',description ='".$description."',vendor ='".$vendor."',price ='".$price."',quantity ='".$quantity."' WHERE partnumber = '".$partnumber ."'";

mysql_query($sql) or die ("Error: ".mysql_error());
echo "Database updated.";
header( "refresh:5;url =toner.php" );
?>

It displays Database updated but no changes are made, any assistance is appreciated, and yes I’m aware its vulnerable to injection and that I should be using PDO or MySQLi but I’m still a beginner and this is where I’ve chosen to start learning. Thank you.

  • 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-18T06:37:19+00:00Added an answer on June 18, 2026 at 6:37 am

    Instead of this

    <form action="updateinfo.php" method="post"
    
    $sql = "UPDATE inventory SET partnumber ='".$partnumber."',description ='".$description."',vendor ='".$vendor."',price ='".$price."',quantity ='".$quantity."' WHERE partnumber = '".$partnumber ."'";
    

    Use this :

    <form action="updateinfo.php" method="post">
    
    $sql = "UPDATE inventory SET partnumber ='".$partnumber."',description ='".$description."',vendor ='".$vendor."',price ='".$price."',quantity ='".$quantity."' WHERE partnumber = '".$partnumber."'";
    

    Remove space from '".$partnumber ."'

    Try now maybe it will help you.

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

Sidebar

Related Questions

I have a simple, unsecured, local database that I'm learning with (yes still using
I have simple php validation form that is halfway working. If you leave the
I have simple database - one table with 6 collumns. 3 of them i
I have simple win service, that executes few tasks periodically. How should I pass
I have simple WPF application where I using threads. E.g. In new thread I
I have simple chat program using WCF service. One service use for server and
I have simple text file, and i have to print it using WPF. How
I have simple AJAX function that uses jQuery to return an array of 300
I have simple login form in my website. In given requirements stands, that password
i have simple singleton that sets pdo object from factory class , in the

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.