0

Hi Folks,

I am having problem with my web design. I am making a query that involves two table but it doesnt do anything when i click submit. do i make mistake in the query ?
my code is like this,

<?php
        if ($_POST['action'] == 'show'){

            $requestCompSql = "SELECT REQUEST_COMPONENT_CUTTING.PROJECT_NAME, 
                                      REQUEST_COMPONENT_CUTTING.BASE_PLATE, 
                                      REQUEST_COMPONENT_CUTTING.THICKNESS, 
                                      REQUEST_COMPONENT_CUTTING.QTY_REQUESTED,
                                            COMPONENT_CUTTING.QTY_REQUIRED,
                                      REQUEST_COMPONENT_CUTTING.REQUESTER, 
                                      REQUEST_COMPONENT_CUTTING.REQUEST_DATE 
                                            FROM REQUEST_COMPONENT_CUTTING INNER JOIN COMPONENT_CUTTING
                                            ON REQUEST_COMPONENT_CUTTING.PROJECT_NAME = COMPONENT_CUTTING.PROJECT_NAME
                                                WHERE REQUEST_COMPONENT_CUTTING.THICKNESS = COMPONENT_CUTTING.THICKNESS
                                                AND REQUEST_COMPONENT_CUTTING.BASE_PLATE = COMPONENT_CUTTING.BASE_PLATE
                                                AND COMPONENT_CUTTING.BASE_PLATE = '{$_POST["bp"]}'";

            $requestCompParse = oci_parse($conn, $requestCompSql);

            oci_execute($requestCompParse);

            while($row = oci_fetch_assoc($requestCompParse)){

            echo "<div class='table-responsive'>";
            echo "<table class='table table-bordered'>";
                                    echo '<table cellspacing = "0"';
                                        echo '<thead>';
                                        echo '<tr>
                                                  <th>PROJECT</th>
                                                  <th>BASEPLATE</th>
                                                  <th>THICKNESS</th>
                                                  <th>QTY REQUESTED</th>
                                                  <th>QTY REQUIRED</th>
                                                  <th>REQUESTER</th>   
                                                  <th>REQ. DATE</th>
                                                  <th align="center">ACTION</th>  
                                              </tr>
                                              </thead>';

                                         echo "<tbody>";
                                            echo "<tr class='warning'><td>$row[PROJECT_NAME]</td>";
                                            echo "<td>$row[BASE_PLATE]</td>";
                                            echo "<td>$row[THICKNESS]</td>";
                                            echo "<td>$row[QTY_REQUESTED]</td>";
                                            echo "<td>$row[QTY_REQUIRED]</td>";
                                            echo "<td>$row[REQUESTER]</td>";
                                            echo "<td>$row[REQUEST_DATE]</td>";
                                            echo "<td><input type='button' value='OK' class='btn btn-success'>
                                                <input type='button' value='REJECT' class='btn btn-danger'></td>";

                                            echo "</tr>";
                                         echo "</tbody>";
                                     echo "<table cellspacing = '0'";
                                     echo "</div>";
            }
        }
?>
4
Contributors
3
Replies
13
Views
3 Years
Discussion Span
Last Post by AndrisP
0

"it doesn't do anything" doesn't mean anything.
What "doesn't do anything"?
Most likely you've made a mistake and the server never gets called, which would place the realm of this question well outside the scope of this forum.

0

Check for errors when you execute your query. My guess is your query is malformed, due to the way you put your POST variable in there, or your quoting in that line is off.

0

Put after line 17:

if(!$requestCompParse){
    $e = oci_error($conn);
    echo "Parse error: ".$e['message'];
    }

replace line 19 to:

$ex = oci_execute($requestCompParse);

and put after line 19:

if(!$ex){
        $e = oci_error($requestCompParse);
        echo "Execute error: ".$e['message'];
        }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.