I have the following code tells me the errors:
mysql_query () expects parameter 2 to be resource, string given in C: \ AppServ \ www \ tableentradaysalida \ index.php on line 35
mysql_error () expects parameter 1 to be resource, null given in C: \ AppServ \ www \ tableentradaysalida \ index.php on line 35 database error:
line 35 is this:
$resultset = mysql_query($conn, $sql) or die("database error:". mysql_error($conn));
<tbody>
<?php
$sql = "SELECT emp_id, emp_name, emp_email, emp_salary, emp_age FROM emp ORDER BY emp_id DESC LIMIT 10";
$resultset = mysql_query($conn, $sql) or die("database error:". mysql_error($conn));
if(mysql_num_rows($resultset)) {
while( $rows = mysql_fetch_assoc($resultset) ) {
?>
<tr>
<td><?php echo $rows['emp_id']; ?></td>
<td><?php echo $rows['emp_name']; ?></td>
<td><?php echo $rows['emp_email']; ?></td>
<td><?php echo $rows['emp_salary']; ?></td>
<td><?php echo $rows['emp_age']; ?></td>
</tr>
<?php } } else { ?>
<tr><td colspan="5">No records to display.....</td></tr>
<?php } ?>
</tbody>
What is the error? Could you help me please?