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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:13:38+00:00 2026-05-29T05:13:38+00:00

ive been trying to make a form with drop downs which are populated from

  • 0

ive been trying to make a form with drop downs which are populated from different tables and then upload that data into another table.

ive cobbled together the following code but when submitting the form the data in the table shows as ‘Array’ and not the selected item from the dropdown, the ‘Qty’ at the end submits fine.

<?php
include ('../connect.php');

if(isset($_POST['submit']))
{

$qty = $_POST['qty'];
$mob_name = $_POST['mob_name'];
$item_img = $_POST['item_img'];
$item_name = $_POST['item_name'];


//save the name of image in table
$query = mysql_query("INSERT INTO tbl_drop VALUES('','$mob_name','$item_img','$item_name','$qty')") or die(mysql_error());


}

$query_Recordset1 = "SELECT mob_name FROM tbl_img ORDER BY mob_name ASC";
$Recordset1 = mysql_query($query_Recordset1) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

$query_Recordset2 = "SELECT item_name FROM tbl_itm ORDER BY item_name ASC";
$Recordset2 = mysql_query($query_Recordset2) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);

$query_Recordset3 = "SELECT item_img FROM tbl_itm ORDER BY item_name ASC";
$Recordset3 = mysql_query($query_Recordset3) or die(mysql_error());
$row_Recordset3 = mysql_fetch_assoc($Recordset3);
$totalRows_Recordset3 = mysql_num_rows($Recordset3);

?>

<html>
<head>
<title></title>
</head>

<body>
<form id="form1" name="form1" enctype="multipart/form-data" method="post" action="new_drop.php">
<label>Mob Name:
<select name="mob_name" id="mob_name">
<?php
do {
?>
<option value="<?php echo $row_Recordset1?>"><?php echo $row_Recordset1['mob_name']?></option>
<?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
?>
</select>
</label>
<p>
<label>Item Name:
<select name="item_name" id="item_name">
<?php
do {
?>
<option value="<?php echo $row_Recordset2?>"><?php echo $row_Recordset2['item_name']?></option>
<?php
} while ($row_Recordset2 = mysql_fetch_assoc($Recordset2));
$rows = mysql_num_rows($Recordset2);
if($rows > 0) {
mysql_data_seek($Recordset2, 0);
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
}
?>
</select>
</label>
<p>
<label>Item Image:
<select name="item_img" id="item_img">
<?php
do {
?>
<option value="<?php echo $row_Recordset3?>"><?php echo $row_Recordset3['item_img']?></option>
<?php
} while ($row_Recordset3 = mysql_fetch_assoc($Recordset3));
$rows = mysql_num_rows($Recordset3);
if($rows > 0) {
mysql_data_seek($Recordset3, 0);
$row_Recordset3 = mysql_fetch_assoc($Recordset3);
}
?>
</select>
</label>
<p>
<label>Quantity:
<input type='text' name='qty' />
</label>
<p>
<label>
<input type="submit" name="submit" id="submit" value="Submit" />
</label>
</p>
</form>
</body>
</html>
<?php
mysql_free_result($Recordset1);
mysql_free_result($Recordset2);
mysql_free_result($Recordset3);
?>
  • 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-29T05:13:39+00:00Added an answer on May 29, 2026 at 5:13 am

    There is a mistake in your code:

    <option value="<?php echo $row_Recordset3?>"><?php echo $row_Recordset3['item_img']?></option>
    

    Should be

    <option value="<?php echo $row_Recordset3['item_img']?>"><?php echo $row_Recordset3['item_img']?></option>
    

    $row_Recordset3 is an array containing values. So if you are echoing the value of an array ,it will show as array and the value of option block become array.

    so you need to change $row_Recordset3 in option value to $row_Recordset3['item_img']

    Hope this helps 🙂

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

Sidebar

Related Questions

I'm trying to make a simple form that contains textboxes that draw from a
Ive been trying to display formatted content blocks from a xml file with no
I've been trying to make a generic class to represent a range of values
I've been trying to make GNU gdb 6.5-14 to use the source code embedded
I've been trying to get input with IUP to make a small pong game.
I've been trying to figure out how I can make a query with MySQL
Ive been playing around with delegates trying to learn and I ran into one
i am trying to create a fade effect with the following...ive been told im
I've been trying to understand how Ruby blocks work, and to do that I've
i've been trying to modify the program so that it could accept more than

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.