473,320 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how do i get the id to store in my table instead of the name field displayed in DDL

I am using code that looks something like this:
[php]
<?php
mysql_connect("localhost", "xxxx_xx", "xxx") or die(mysql_error());
mysql_select_db("xxxx_xxx") or die(mysql_error());
$query="SELECT Bloom_Name FROM ihs";
$result = mysql_query($query);

echo '<select name="ihs" onchange="this.form.submit()">';
while($nt=mysql_fetch_array($result)){ //Array or records stored in $nt
echo '<option value="' . $nt['id'] . '">' . $nt['Bloom_Name'] . '</option>';
/* Option values are added by looping through the array */
}
echo '</select>'; // Closing of list box
?>
[/php]how do i get the id to store in my table instead of the name field displayed in Drop Down List
Mar 11 '08 #1
4 1314
ronverdonk
4,258 Expert 4TB
You know that we expect your code to be posted in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use the tags in future.

MODERATOR.
Mar 11 '08 #2
ronverdonk
4,258 Expert 4TB
After submit, the $_POST array contains all selected values under key 'ihs'. To check this, print the $_POST array in the second phase where you process your submitted form[php]print_r($_POST);[/php]
Ronald
Mar 11 '08 #3
[php]print_r($_POST);[/php] this help.
was able to see where the error was..

thanks
Mar 12 '08 #4
ronverdonk
4,258 Expert 4TB
[php]print_r($_POST);[/php] this help.
was able to see where the error was..

thanks
You're welcome. See you next time.

Ronald
Mar 12 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: bart plessers | last post by:
Hello, below you will find a simple script that reads out info of a dbase It reads out all the records and every field of the record. For my table header, I want to display the field names of...
3
by: Newbie | last post by:
Hi all, A have several forms with unbound combo boxes, the combo boxes are used to filter the data in the forms. What I would want is that my application stores the most recent settings of these...
3
by: GL | last post by:
Hi, Is there a way to add a field to an existing table using a query of some sort (without needing to manually add a field to the table). I know how to do it with a make table query, but I have...
2
by: Gary T. | last post by:
I have a subform (that is linked to a table) in a blank form. When the table is viewed in its subform state in the form, the headings are not user friendly. ie. CustN I would want it to read in...
16
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record...
0
by: Big George | last post by:
I'm developing with ASP.NET, VS.NET 2003. Using Crystal Report for VS.NET DataBase: Oracle 10g I store a BLOB field in a table. This field store images, like jpg files. The Stored Procedure...
11
by: c676228 | last post by:
Hi everyone, I am just wodering in asp program, if there is anybody writing store procedure for inserting data into database since there are so many parameters need to be passed into store...
2
by: David - Australia | last post by:
G'day from Australia, I'm hoping some bright spark may be able to help me with this one. I'm sure that it can be done, I've just hit a wall with it. So I'm opening it up. I'm storing student...
7
by: billelev | last post by:
I'm building a database and am a bit stumped about how to construct/link tables. I will describe the current configuration, then present the problem I am trying to solve. Currently: I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.