I want to show some records in a Custom File, through this statement:
but having following error:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, array given in C:\xampp\htdocs\crm\views\Userdb.php on line 1790<?php
$result=ExecuteRow("SELECT employees_user_name FROM employees") ;
while($row=mysqli_fetch_array($result))
{
echo $row['employees_complete_name'];
}
?>
ExecuteRow() already returns the row, you simply use, e.g.
$row = ExecuteRow("SELECT * FROM employees WHERE ...") ;
echo $row['employees_complete_name'];
$row = ExecuteRows(“SELECT * FROM employees WHERE …”) ;actually it is bunch of rows i want to get. Means ExecuteRows
but having error.
If you use ExecuteRows(), the result is an array, you may loop it like:
$rows = ExecuteRows("SELECT * FROM employees WHERE ...") ;
foreach ($rows as $row) {
echo $row['employees_complete_name'];
}
Change this part:
while($row=mysqli_fetch_array($result))to:
foreach ($rows as $row)
In addition, change also this part:
$result=ExecuteRow(“SELECT employees_user_name FROM employees”);to:
$rows = ExecuteRows(“SELECT employees_user_name FROM employees”);
Thanks. It works.