-3

I see this error:

Notice: Undefined index: pageno in C:\xampp\htdocs\ims\public\includes\process.php on line 81 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-5,5' at line 1

    //manage category
if(isset($_POST["manageCategory"])){

    $m = new Manage();
    $result = $m->manageRecordWithPagination("categories",$_POST["pageno"]);
    $rows = $result["rows"];
    $pagination = $result["pagination"];

    if(count($rows)> 0){
        $n = 0;
        foreach ($rows as $row){
    ?>
      <tr>
        <td><?php echo ++$n; ?></td>
        <td><?php echo $row["category"]; ?></td>
        <td><?php echo $row["parent"]; ?></td>
        <td><a href="#" class="btn btn-success btn-sm">Active</a></td>
        <td>
         <a href ="#" did="" class="btn btn-danger btn-sm">Delete</a>
         <a href ="#" class="btn btn-info btn-sm">Edit</a>
        </td>
      </tr>

    <?php

        }
        ?>

        <tr><td colspan="5"><?php echo $pagination; ?></td></tr>
        <?php
        exit();
    }
ata
  • 3,398
  • 5
  • 20
  • 31
Naeema
  • 1
  • 3
  • 1
    You are actually (hint!) seeing two errors, but you are not asking a question. Please, read [ask] and provide a [mcve]. – Ulrich Eckhardt May 01 '18 at 09:14
  • It seems `$_POST["pageno"]` does not exist. About the other error in database query, show us the code. – ata May 01 '18 at 09:16
  • change your 1st if condtion to `if(isset($_POST["manageCategory"]) && isset($_POST["pageno"])){}` – lazyCoder May 01 '18 at 09:25
  • Possible duplicate of [PHP: "Notice: Undefined variable", "Notice: Undefined index", and "Notice: Undefined offset"](https://stackoverflow.com/questions/4261133/php-notice-undefined-variable-notice-undefined-index-and-notice-undef) – B. Desai May 01 '18 at 09:26
  • you should avoid using $_POST, $_GET etc without data validation – Nerius Jok May 01 '18 at 09:27

1 Answers1

0

There are high possibility that "pageno" is not defined in your $_POST , so to check this you need to run this statement :

print_r($_POST);

Kindly check its existence.

bansal
  • 99
  • 8