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

Question on how to query db

36
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:

Expand|Select|Wrap|Line Numbers
  1. //create the text field
  2. echo("<input type=text name=opt_qty value=".$_SESSION['opt_qty_vals'][$opt_indx]." onBlur='submit();' class='qty_input'>");
  3. echo("</td>");
  4. //store user input
  5. $user_input_strike = $_GET['opt_qty'];
  6. //create the query
  7. $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_strike";
  8. //prepare query
  9. $parsed1 = ociparse($db_conn, $query1);
  10. //Execute statment
  11. $succ1 = ociexecute($parsed1);
  12. //from  what I understand this stores everything in an array.
  13. $results = oci_fetch_all($succ1);
  14.  
  15. //output array for debugging purposes.
  16. var_dump("$results2");
  17.  
  18.  
Jul 20 '07 #1
0 971

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

Similar topics

8
by: Együd Csaba | last post by:
Hi All, how can I improve the query performance in the following situation: I have a big (4.5+ million rows) table. One query takes approx. 9 sec to finish resulting ~10000 rows. But if I run...
3
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I...
2
by: Test User | last post by:
Hi all, (please excuse the crosspost as I'm trying to reach as many people as possible) I am somewhat familiar with Access 2000, but my latest project has me stumped. So, I defer to you...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
2
by: Tom | last post by:
This is related to an earlier post entitled "Text in Query/Numbers in Report" Brief recap - report has a query as a record source. The query shows the correct data, the report translating the...
3
by: cover | last post by:
I have a table with 50 fields that receive input depending on whether that input came in from a 'shaker' form or a 'conveyor' form. Input from the 'conveyor' form might populate 25 fields while...
5
by: ric_deez | last post by:
Hi there, I would like to create a simple search form to allow users to search for a job number based on a number of parameters. I think I understand how to use parameteres associated with Stored...
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
14
by: Ralf Rottmann \(www.24100.net\) | last post by:
I recently stumbled across a pretty interesting LINQ to SQL question and wonder, whether anybody might have an answer. (I'm doing quite some increasing LINQ evangelism down here in Germany.). ...
2
by: Jeff | last post by:
I have an increasingly-complicated query string that sends results to an Excel file; I've broken the query somehow. Currently using Access 2007, DAO recordset via late binding (we don't have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.