Jump to content

form submission missing data


tgribble

Recommended Posts

hello

 

this form is not submitting all the 'jeweltype' data to the mysql db. help please

 

=============================================

 

 

 

 

 

html>

<head>

<title>Upload an image to a database</title>

</head>

<body>

 

  <table>

    <form name="Picture" enctype="multipart/form-data" method="post">

      <tr>

        <td>Upload <input type="file" name="imagefile"><br />

Jewelery Type:

            <select>

<?php

$sql="SELECT jeweltype FROM jeweltypes";

            $result =mysql_query($sql);

            while ($data=mysql_fetch_assoc($result))

{

            ?>

            <option value="jeweltype"><?php echo $data['jeweltype'] ?></option>

            <?php

}

?>

            </select>

            <br />

       

      <input type="submit" name="xsubmit" value="Upload">

      </td>

      </tr>

      <tr>

      <td>Latest Image</td>

      </tr>

      <tr>

      <td><img src="?pic=1"></td>

      </tr>

    </form>

 

</table>

 

</body>

</html>

 

==========================================

with this query

==========================================

 

<html> 

<head><title>Your Page Title</title></head> 

<body> 

<?php 

include ('connect.php');

@mysql_select_db($database) or die( "Unable to select database"); 

$result = mysql_query( "SELECT jeweltype FROM jewel_images" ) 

or die("SELECT Error: ".mysql_error()); 

$num_rows = mysql_num_rows($result); 

print "There are $num_rows records.<P>"; 

print "<table width=400 border=1>\n"; 

while ($get_info = mysql_fetch_row($result)){ 

print "<tr>\n"; 

foreach ($get_info as $field) 

print "\t<td><font face=arial size=1/>$field</font></td>\n"; 

print "</tr>\n"; 

print "</table>\n"; 

?> 

</body> 

</html>

 

Link to comment
Share on other sites

  {

              ?>

              <option value="jeweltype"><?php echo $data['jeweltype'] ?></option>

              <?php

      }

 

 

Should be

 

  {

              ?>

              <option value="<?php echo $data['jeweltype'] ?>"><?php echo $data['jeweltype'] ?></option>

              <?php

      }

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.