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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:13:39+00:00 2026-06-04T19:13:39+00:00

I’m using a script to update my record via php in mySQL. All of

  • 0

I’m using a script to update my record via php in mySQL. All of the fields can be updated except $part_no.

I can’t figure out why “part_no” will not update.

Appreciate any help.

<?php session_start();


$type=$_POST['type'];
$part_no=$_POST['part_no'];
$description=$_POST['description'];
$artwork=$_POST['artwork'];
$min=$_POST['min'];
$max=$_POST['max'];

$db="naturan8_hero";

$link = mysql_connect("localhost", "XXXXXXX", "XXXXXX");
if (! $link)
die("Couldn't connect to MySQL");
mysql_select_db($db , $link)
or die("Couldn't open $db: ".mysql_error());
$query = mysql_query(" UPDATE cartons_current SET type='$type' , part_no='$part_no',     description='$description',artwork='$artwork', min='$min' , max='$max' WHERE part_no='$part_no' ");

if($query) {
header("location: inv_fc_edit_success.php?part_no=" . urlencode($part_no));
}else{
header("location: inv_fc_edit_fail.php");
}

?>

Here is the form for editing:

<?php
$record = $_POST['part_no'];


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

$result=mysql_query(" SELECT * FROM cartons_current WHERE part_no='$record'");
$num=mysql_num_rows($result);
$i=0;
while ($i < $num) {

$type=mysql_result($result,$i,"type");
$part_no=mysql_result($result,$i,"part_no");
$description=mysql_result($result,$i,"description");
$artwork=mysql_result($result,$i,"artwork");
$min=mysql_result($result,$i,"min");
$max=mysql_result($result,$i,"max");
?>


<div id="fcICON">Hero</div>
<div id="titleWRAP">
<div id="newTITLE">Edit Part Number</div>
<div id="newINS">This area is designated for editing a part number. Please <b>be careful and alert </b>to your changes, because they are immediately posted.</div>
</div>
<div class="form_hero_new">
<form id="form_editX" method="POST" action="inv_fc_edit2.php"   onfocus="this.value=''">
  <input type="hidden" name="type" type="text" value="FC">
  <input type="hidden" name="part_no" value="<? echo "$record" ?>">
  <div style="width: 500px; height:63px;float:left;">
    <div style="width: 165px; height:65px;float:left;">
      <div id="heroLABEL" style="width:150px">Part Number</div>
      <div id="newPN">
        <textarea name="part_no"  maxlength="20" minlength="6" type="text" style="width: 130px;color:#FFFF00"><? echo "$part_no"?></textarea>
      </div>
  • 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-04T19:13:41+00:00Added an answer on June 4, 2026 at 7:13 pm

    You are setting part_no to its existing value, which will make no change:

    UPDATE cartons_current SET part_no='$part_no' WHERE part_no='$part_no'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
this is what i have right now Drawing an RSS feed into the php,

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.