473,666 Members | 2,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help querying a db

36 New Member
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
1 1125
debasisdas
8,127 Recognized Expert Expert
If the data is in databse table it will never happen that the output will be NULL or anything else.

There must be some probelm in the program.
as i have on idea of PHP ,would suggfest you to try parsing the input variable to proper type.
Jul 21 '07 #2

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

Similar topics

4
2249
by: Michael Whittaker | last post by:
Hello! I have a problem with my php script. The script's task is to search an IP-Database with ranges as entries and find, in which range the entered IP is. OK, I've queried the MySQL-Results of the ranges into an array, containing the "IP ==> internalid" where internalid is the Primarykey of the table from which I can get
3
1825
by: Keith | last post by:
I am fairly new to SQL so sorry if this is a really dumb question. I have a small (still) SQL database, which I am trying to query from an ASP page. The field I am querying is of DATETIME data type, and is populated automatically using the GetDate() function as a default value. When I try and search on this field, using a date/time in the format dd/mm/yyyy hh:mm:ss as the search criteria, it fails with the following
1
2095
by: valexena | last post by:
After a few minutes of querying the database my session disconnects abruptly. Can somebody help me and tell why can be happening? -- Posted via http://dbforums.com
1
1412
by: Ron L. | last post by:
Hi, Any suggestions for a good intorudction to OLAP querying with MDX? Thanks, Ron. -- Performance Intelligence, Inc. Spy 4 DB2 - http://www.pireporting.com/spy4db2.html
3
1170
by: amore | last post by:
im new in xml. It looks like large xml data(inside elements) was truncated every time i open it on my editor(dreamweaver or visual studio). is there any way of fixing that? which is faster, querying data in mysql or parsing data in xml?
2
1400
by: Elliot Rodriguez | last post by:
As I continue to read more about the benefits of database querying using ADO.NET, I am having a more difficult time distinguishing what the best approach to data retrieval is anymore. When creating datasets in the Visual Studio.NET designer, Command objects (Update, Insert, Delete) are automatically generated for you based off your SelectCommand value. You then get the benefits of strong typing, which from what I've seen so far are...
3
1577
by: MDB | last post by:
I'd normally Google for a question like this, and hope to snag a few examples along with the answer, but this time I can't see to get the keywords specific enough. Or I'd ask coworkers, but they're just as new to ASP.NET as I am. Is it possible to have a dataset filled with all the records in an SQL table (on the small side, maybe three hundred records total), and then query that table for subsets of data, e.q. a simple WHERE clause,...
1
1190
by: Stephane | last post by:
Hi, In my ASP.Net application, I want to read a list of RSS feed every 30 minutes. To start this, I check the current minute and I do a modulo 30. Once it's started, I check in my database and I call all RSS feed that I have. It's actually about 10 RSS feeds, but it can grow up to 400 or 500. I was wondering I I'd better use a new thread for this. I don't want the we site to freeze every 30 minutes because it's jammed querying RSS...
9
1652
by: Algonquin J. Calhoun | last post by:
I've developed an application that exceeds the Access 2GB limit. This application was developed as a prototype and the users have found it very useful. Approximately 45,000 records are added to the database each day. Every 3 months I have to archive some of the older detail rows to allow continued running of the application against the most current 90 day data. The users have decided to incorporate ALL of the data for their analysis. ...
4
1522
by: =?Utf-8?B?U3VoYXMgVmVuZ2lsYXQ=?= | last post by:
Hello, I am facing an issue while querying Active directory using C# code with system.DirectoryServices namespace. Here is the path for my LDAP - "LDAP://CN=XY - C++/Unix and other, OU=Automatic,OU=DLs,DC=domain,DC=com"; I have replaced the / character with\/- but still is giving error while querying. Please help me to resolve this.
0
8866
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8550
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7381
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4193
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4365
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2006
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.