Im getting a parse error, and its telling me the
mysql_fetch_row command is an invalid command?
Im wondering if its invalid, what am I to use to get data displayed in the table here? Below Ive included the parse error, and the code Im using
Any help on fixing this is much appreciated
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/jetlinka/public_html/memphisair/roster/index_content.php on line 15
Code:
<?php
mysql_connect("localhost", "jetlinka_mei", "memphis");
$db = mysql_connect('localhost', 'jetlinka_mei', 'memphis');
if (!$db) {
// Select the database you want to use – You can use a variable here too instead
if (!mysql_select_db('jetlinka_mei')) { // Did selection fail?
// Handle error
echo 'DB Selection failed. <br />Error # ', mysql_errno(), ' Error msg: ', mysql_error();
exit;
}
$sql = "SELECT name, email FROM join";
$result = mysql_query($sql, $db);
if (!$result) {
// Handle error
echo 'Query failed. SQL: ', $sql, '<br />Error # ', mysql_errno(), ' Error msg: ', mysql_error();
exit;
}
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="12%"><b>Rank</b></td>
<td width="25%"><b>Name</b></td>
<td width="10%"><b>PID</b></td>
<td width="10%"><b>Hours</b></td>
</tr>
<?
while ($row = mysql_fetch_row($resultid)) //Don't capitalize what doesn't need to be
{
print "<tr>";
foreach ($row as $field)
{
print "<td>$field</td>";
}
print "</tr>";
}
print "</table>";
mysql_close;
?>