Hi
Im working with php and an oracle database. Anyway I am having a user input into a text field. The input is then stored into a variable and used in a query to the database. I am currently testing this program and I am trying to see the exact result of the query by just echoing the result using var_dump. So the problem is I cant get the actual result of the query out on the screen. For example I type in "59" into the input field already knowing that this value is in the db. I then output the variable I store the query result in and I dont get the same number. I actually get either blank or the word "NULL". I dont know what the problem is Ive been torturing myself trying to figure this out. I want to compare the users input to actualy info in the db. So if I say "select 59 from table" I want the result to be 59. Can someone take a look and see if they can find anything wrong or see if this is how the query should be to get the result I want to obtain.
Thanks
Heres the code piece:
[CODE=php]
//create the text field
echo("<input type=text name=opt_qty value=".$_SESSI ON['opt_qty_vals'][$opt_indx]." onBlur='submit( );' class='qty_inpu t'>");
echo("</td>");
//store user input
$user_input_str ike = $_GET['opt_qty'];
//create the query
$query1 = "select strike from surfaces where undl_indx = $undl_indx and and expire_date = ".$_SESSION['opt_exd_vals'][$opt_indx]." and call_put = '".$_SESSION['opt_cp_vals'][$opt_indx]." and strike =$user_input_st rike";
//prepare query
$parsed1 = ociparse($db_co nn, $query1);
//Execute statment
$succ1 = ociexecute($par sed1);
//from what I understand this stores everything in an array.
$results = oci_fetch_all($ succ1);
//output array for debugging purposes.
var_dump("$resu lts2");
[/CODE]
Im working with php and an oracle database. Anyway I am having a user input into a text field. The input is then stored into a variable and used in a query to the database. I am currently testing this program and I am trying to see the exact result of the query by just echoing the result using var_dump. So the problem is I cant get the actual result of the query out on the screen. For example I type in "59" into the input field already knowing that this value is in the db. I then output the variable I store the query result in and I dont get the same number. I actually get either blank or the word "NULL". I dont know what the problem is Ive been torturing myself trying to figure this out. I want to compare the users input to actualy info in the db. So if I say "select 59 from table" I want the result to be 59. Can someone take a look and see if they can find anything wrong or see if this is how the query should be to get the result I want to obtain.
Thanks
Heres the code piece:
[CODE=php]
//create the text field
echo("<input type=text name=opt_qty value=".$_SESSI ON['opt_qty_vals'][$opt_indx]." onBlur='submit( );' class='qty_inpu t'>");
echo("</td>");
//store user input
$user_input_str ike = $_GET['opt_qty'];
//create the query
$query1 = "select strike from surfaces where undl_indx = $undl_indx and and expire_date = ".$_SESSION['opt_exd_vals'][$opt_indx]." and call_put = '".$_SESSION['opt_cp_vals'][$opt_indx]." and strike =$user_input_st rike";
//prepare query
$parsed1 = ociparse($db_co nn, $query1);
//Execute statment
$succ1 = ociexecute($par sed1);
//from what I understand this stores everything in an array.
$results = oci_fetch_all($ succ1);
//output array for debugging purposes.
var_dump("$resu lts2");
[/CODE]