By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,982 Members | 1,738 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,982 IT Pros & Developers. It's quick & easy.

variables not getting the right values

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.