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>";
            }
        }
?>

"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.

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.

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'];
        }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.