hi all! i have here a code.
<?php
/**
* Main.php
*/
include("include/session.php");
?>
<html>
<head>
<title>Export to Excel</title>
</head>
<body>
<form action="saverec.php" method="post">
<?php
define ('DB_NAME', 'vincegac_vince');
define ('DB_USER', 'root');
define ('DB_PASSWORD', '');
define ('DB_HOST', 'localhost');
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db(DB_NAME, $link);
if (!$db_selected) {
die('Can\'t use ' . DB_NAME . ': ' . mysql_error());
}
$strSQL = "SELECT * FROM employee WHERE proj_mgr = '$session->username'";
$rs = mysql_query($strSQL);
?>
<table border="1">
<tr>
<th>Employee Name</th><th>Home Address</th><th>Email Address</th><th>Office/project number</th><th>Mobile number</th><th>Home number</th>
<th>Position</th><th>Practice</th>
</tr>
<?php
while($row = mysql_fetch_array($rs)) {
?>
<tr>
<td><?php echo $row['lname'] . ", " . $row['fname'] ?></td><td><?php echo $row['homeadd'] ?></td>
<td><?php echo $row['emailadd'] ?></td><td><?php echo $row['ofcnum'] ?></td><td><?php echo $row['mobilenum'] ?></td>
<td><?php echo $row['homenum'] ?></td><td><?php echo $row['position'] ?></td><td><?php echo $row['practice'] ?></td>
</tr>
<?php
}
?>
</table>
<?php mysql_close(); ?>
<input type="submit" name="Submit" value="Save" >
</form>
</body>
</html>
and when i execute it, i get this error
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\testing\export.php on line 43