473,322 Members | 1,259 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,322 software developers and data experts.

variables not getting the right values

I have a form that has the ID values of various fields from listboxes, etc.,
which are generated from a db query, assigned to variables. The variables
hold the returned $_POST['fieldvalue'] fine, but I also need variables to
hold the labels. I have tried a few options such as running a secondary
query where the selected form value = the label, i.e.

-sample code-

//set variables:

$tooltype_id = $_POST['toolType'];
$toolcat_id = $_POST['toolCat'];
$primeproj_id = $_POST['project'];

//get group and project code and set variables

$query_groupcode = "SELECT groupCode, projCode from groups, proj WHERE
groups.groupID = proj.groupID AND proj.projID = '$primeproj_id'";
$groupname = $query_groupcode['groupCode'];
$projcode = $row_projects['projCode'];

//get tooltype codes

$query_toolpath = "SELECT toolType FROM toolType WHERE toolTypeID =
'$tooltype_id'";
$tooltype = $query_toolpath['toolType'];
- end code -

I then checked to see the variable values:

-code sample-
echo $tooltype_id.' tooltype_id<br />';
echo $toolcat_id.' toolcat_id<br />';
echo $primeproj_id.' primeproj_id<br />';
echo $groupname.' groupname<br />';
echo $projcode.' projcode<br />';
echo $tooltype.' tooltype<br />';
-end code-

this is the result - the data from the db comes across only as 'S':
2 tooltype_id
3 toolcat_id
5 primeproj_id
S groupname
S projcode
S tooltype

I'm sure this is just a stupid little error that I'm not seeing....or that
there is a reasonable way to collect the label values.
Jul 13 '06 #1
1 1383
I got it - I was referencing the query arrary incorrectly.

"Chris" <de************@centurytel.netwrote in message
news:e9**********@news01.intel.com...
>I have a form that has the ID values of various fields from listboxes,
etc., which are generated from a db query, assigned to variables. The
variables hold the returned $_POST['fieldvalue'] fine, but I also need
variables to hold the labels. I have tried a few options such as running a
secondary query where the selected form value = the label, i.e.

Jul 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Larry L | last post by:
I have a Module that declares several arrays as public, some string, some integers. I then have 2 forms. Form A is the main form, that loads on start-up, and has a command button to open Form B. On...
2
by: Sami | last post by:
I keep getting the famous 'Too Many Connection' Error, and don't know how to change my variables, so they persist even if i have to restart mysql service. Platform: Windows 2003 Server My...
7
by: Michael | last post by:
Hi newsgroup, as the subject indicates I am looking for an advice using global variables. I am not if this problem is more about style then C. If its wrong in thi group, sorry. So I have a...
12
by: Rene | last post by:
I understand that if I don't assign a *local* variable before I use it, the compiler will generate a "Use of unassigned local variable" error. What I don't get is why doesn't the compiler just...
4
by: ruca | last post by:
Hi, How can I pass the values of some variables from page1.aspx to page2.aspx? I try to define some variables in page2 and then when I click a button in page1 it will fill that variables (in...
14
by: Coleen | last post by:
Hi All :-) We have an APSX application using VB.net as the code behind, which uses one or two session variables per page. These Session variables are passed to the final page and calculations...
5
by: the_jos | last post by:
Dear reader, I am trying some things with xml/xsl and cannot find a solution for what I would like to do. I have 2 base items with name and price and two that are composed of base two (given...
12
by: MrHelpMe | last post by:
Hello again all, I've finished my whole application and now I don't like the whole session variables that I am using. I have a form, user fills in info clicks submit and using CDOSYSMail an...
4
by: icarus | last post by:
global_vars.py has the global variables set_var.py changes one of the values on the global variables (don't close it or terminate) get_var.py retrieves the recently value changed (triggered right...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.