I have a following problem in my project.
The administrator add the buyerid,styleno,buyername,buyeraddress and phone no to the system.(Buyerid is Auto increment.It is not adding by the admin.)
When that added it goes to the table addnewbuyer in database.After adding this information buyerid is given to the buyer.
From this buyer id he will login to the system using his password.This data goes to the table userlogin.
After buyer, enter to the system using userid and password he will go to the interface for a uploading file.
In this interface there is field for styleno,buyername,buyeraddress,quantity and upload a file and submit.I want to auto fill the field styleno and buyername feild using id.Here is what i did.but it is wrong.Can I have a help regarding this
I want to autofill the styleno and Buyername auto fill when user enter his userid to the datbase.

This is my form which shows upload file interface for buyer.


<form id="form_387346" class="appnitro" enctype="multipart/form-data" method="post" action="upload.php">

                    <div class="form_description">
            <h2>Upload New Style</h2>

        </div>   
                <table>
          <tr>
            <td width="38%"><label class="description" for="title">BuyerName:</label></td>
            <td width="62%"><input class="required"  type='text' name='title' id="txtrefer"></td>
            </tr>
          <tr>
            <td><label class="description" for="styleno">StyleNo:</label></td>
            <td><input type='text' name='styleno' value"<?php 
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("apperal", $con);

$result = mysql_query("SELECT * FROM addnewbuyer ORDER BY id DESC LIMIT 1");

while($row = mysql_fetch_array($result))
  {
      {

  echo $row['styleno'];

      }

  }
mysql_close($con);
?>"></td>
            </tr>
          <tr>
            <td><label class="description" for="quantity">Quantity:</label></td>
            <td><input type='text' name='quantity'></td>
            </tr>
          <tr>
            <td><label class="description" for="txtamount">RequestedDate:</label></td>
            <td><input class="description" type='text' name='datepicker' id='datepicker'></td>
            </tr>
          <tr>
            <td height="33"><label class="description" for="txtamount">UploadFile</label></td>
            <td><input type='file' class="required" name='myfile' id='myfile'></td>
            </tr>
  <td height="1">
  <tr>
    <td height="25"></td>
    <td><input type='submit' name='submitbutton' value='Submit' class="button_text" ></td>
  </tr>
          </table>
        </form>






What i want is the form should find the id buyer enterd & it should compare with the id administrator add to the system and autofill the styleno and buyername according to enterd id by buyer.

Recommended Answers

All 4 Replies

So what is the problem? You said something was wrong, but did not specify.

I want to get the styleno and Buyername auto fill when Id is selected.How can I do that with this code????????????????

you need to lookup the info in your db select info from table blah blah then print the value in each form element

value="<?php print $myValue;?>"

Looks like line 25 is missing the = (assuming the code after that is working).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.