query to oracle database

0

Good afternoon, I need to make a query to an Oracle database, and it shows me this error

  

Fatal error: Uncaught PDOException: SQLSTATE [HY000]: General error:   933 OCIStmtExecute: ORA-00933: SQL command not properly ended   (ext \ pdo_oci \ oci_statement.c: 159) in   C: \ xampp \ htdocs \ oracle \ conexion.php: 40 Stack trace: # 0   C: \ xampp \ htdocs \ oracle \ connectionion.php (40): PDOStatement-> execute () # 1   {main} thrown in C: \ xampp \ htdocs \ oracle \ conexion.php on line 40

<?php
$pagination = new PDO_Pagination($connection);
$contador=1;
$search= null;
$start= null;


    $pagination->rowCount('SELECT NOMBRE FROM MATERIAPRIMA ');
    $pagination->config(8, 10);
    $sql = "SELECT NOMBRE FROM MATERIAPRIMA  LIMIT  $pagination->start_row, $pagination->max_rows";
    $query = $connection->prepare($sql);
    $query->execute();

    $model = array();

    while($rows = $query->fetch(PDO::FETCH_ASSOC))
    {
    $model[] = $rows;
    }

  ?>

    <tr class="active">
    <thead>
    <th>#</th>    
    <th>CÓDIGO</th>
    <th>INSUMO</th>
    <th>USO</th>
    </tr>
    </thead>
    <?php
    foreach($model as $row)
    {
    $contador ='#';
     echo "<tbody id='timeReals'>";  
     echo "<tr>";
     echo "<td>".$contador."</td>";        
     echo "<td>".$row['CODIGO']."</td>";
     echo "<td>".$row['NOMBRE']."</td>";
     echo "<td>".$row['IDUSO']."</td>";
     $contador++;
    }
    ?>
    <?php
    echo "<center>";
    $pagination->pages("bt");
    echo "</center>";
    ?>
    
asked by michi_app 23.10.2018 в 19:47
source

1 answer

1

I am not an expert in programming, but in oracle all commands must end with ";" and in none of your queries do I see it. Did you try to include the ";" directly in the query?

For example:

$ pagination->> rowCount ('SELECT NAME FROM MATERIAPRIMA;');

    
answered by 23.10.2018 в 23:34