0

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in E:\xampp\htdocs\php\oop\codingcage_one\index.php Image

    <table align="center">
    <tr>
    <th colspan="5"><a href="insert-update.php">add data here.</a></th>
    </tr>
    <th>First Name</th>
    <th>Last Name</th>
    <th>City Name</th>
    <th colspan="2">Operations</th>
    </tr>
    <?php

        $res = $con->getdata("SELECT * FROM users ");
        if (mysql_num_rows($res) == 0)
        {

    ?>
    <tr>
    <td colspan="5">Nothing Found Here !</td>
    </tr>
    <?php
        }
        else
        {
            while($row =  mysql_fetch_array($res))
            {
  ?>
        <tr>
        <td><?php echo $row['first_name'];  ?></td>
        <td><?php echo $row['last_name'];  ?></td>
        <td><?php echo $row['user_city'];  ?></td>
        <td align="center"><a href="javascript:edt_id('<?php  ?>')"><img src="b_edit.png" alt="EDIT" /></a></td>
        <td align="center"><a href="javascript:delete_id('<?php  ?>')"><img src="b_drop.png" alt="DELETE" /></a></td>
        </tr>
        <?php
            }
        }
?>
    </table>
Shreyas Achar
  • 1,359
  • 3
  • 31
  • 55
Mushaffaq
  • 1
  • 2

1 Answers1

0
 $res = $con->getdata("SELECT * FROM users ");

Replace with:

  $res = mysql_query("SELECT * FROM users ");
Shailesh Katarmal
  • 2,707
  • 1
  • 11
  • 15