variables not getting the right values

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris

    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_groupcod e = "SELECT groupCode, projCode from groups, proj WHERE
    groups.groupID = proj.groupID AND proj.projID = '$primeproj_id' ";
    $groupname = $query_groupcod e['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.


  • Chris

    #2
    Re: variables not getting the right values

    I got it - I was referencing the query arrary incorrectly.

    "Chris" <designerNOSPAM @centurytel.net wrote in message
    news:e960nl$659 $1@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.

    Comment

    Working...