I am getting a "query failed" message
my db is called markbad_markbadsql the table I am pulling information from is the "opt_in_email" table and the table has 5 fields I want to display.
the fields are:
joined | age | e_mail_address | f_name | l_name |
date | 18 | "address@ | mark | Jones
of coarse I want to display the user information for all the users listed in the "opt_in_email" table here is my php file
<?php
//connect to database
$dbh=mysql_connect ("localhost", "markbad_drpl1", "deleted")
or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("markbad_markbadsql");
// start the query
$query = "|SELECT * FROM opt_in_email";
$result = mysql_query ($query)
or die ("Query failed");
?>
<html>
<head>
<title></title>
</head>
<body>
<?php
// printing HTML result
print "<table>\n";
while ($line = mysql_fetch_array($result)) {
print "\t<tr>\n";
while(list($col_name, $col_value) = each($line)) {
print "\t\t<td>$col_value</td>\n";
}
print "\t</tr>\n";
}
print "</table>\n";
?>
</body>
</html>