googleit
08-29-2006, 08:22 PM
how do i get the mysql results to display as veiw.php?id=#
this is my code so far
$link = mysql_connect('host', 'username', 'pass')
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db('dbname') or die('Could not select database');
$query = 'SELECT * FROM data';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t<tr>\n";
foreach ($line as $col_value) {
echo "\t\t<td>$col_value</td>\n";
}
echo "\t</tr>\n";
}
echo "</table>\n";
mysql_free_result($result);
mysql_close($link);
any help?
this is my code so far
$link = mysql_connect('host', 'username', 'pass')
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db('dbname') or die('Could not select database');
$query = 'SELECT * FROM data';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t<tr>\n";
foreach ($line as $col_value) {
echo "\t\t<td>$col_value</td>\n";
}
echo "\t</tr>\n";
}
echo "</table>\n";
mysql_free_result($result);
mysql_close($link);
any help?