Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2010

    Question Unanswered: PHP Row Fetching Problem

    Hi all. I have a group project for my database course, and one of my duties is to get the search page working. The code I'm going to show involves taking in a query string from a seperate function (that works), and executing it. Then a string variable, $display_string, holds html code as well as the query results while being fetched. My problem is this: when the code executes I keep getting an ORA-24338 error saying that a statement handle isn't being executed. It says this occurs on the line where the while loop for fetching is at. I thought I could figure it out eventually but I haven't had any luck after a couple days of trial and error and research. I hope you guys can help me out.

    if($action == 'do_search'){
            $sql = handle_search();
            throw new redirect('search.php');
            $result = oci_parse($connection,$sql);
    $result = empty($result)? '' : $result;
    $ncols = oci_num_fields($result);
    $display_string = "<table border=1 cellpadding=5>\n";
    $display_string .= "<tr>\n";
    $display_string .= "<th>Address</th><th>City</th><th>State</th><th>Year</th><th>Size</th><th>Bedrooms</th><th>Bathrooms</th><th>Livingrooms</th><th>Basement</th><th>House Type</th><th>Model</th><th>Price</th>\n</tr>\n";
    //Loop through the query results and print them in to the table
    while ($line = oci_fetch_array($result)) {
            $display_string .= "<tr>\n";
            foreach ($line as $col_value)
                    $display_string .= " <td>$col_value</td>\n";
            $display_string .= "</tr>\n</table>";
    // Free resultset
    // Closing connecion
    The error message is:
    Warning: oci_fetch_array() [function.oci-fetch-array]: ORA-24338: statement handle not executed in /.../public_html/dbproj2/search.php on line 48
    Last edited by Squeage; 04-23-10 at 18:11. Reason: Forgot to post error message

  2. #2
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    I suggest posting this to a PHP forum, because it is due to how Oracle is "called".
    It is likely an error of omission & not an error of commission.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Apr 2010
    Oh ok. Thanks anyways.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts