So this is what I have:
<?php
$db_host = "localhost";
$db_username = "root";
$db_pass = "";
$db_name = "OnlineBulletinBoardDB";
@mysql_connect("$db_host","$db_username","$db_pass") or die ("Could no connect to MySQL");
@mysql_select_db("$db_name") or die ("No database");
$query="SELECT PostSubject, FROM postings;";
$result=mysql_query($query);
mysql_close()开发者_运维知识库;
?>
<H1>Post Subject</H1>
<?php echo mysql_num_rows($result); ?>
But its not working, when I try and run it gives me some error on the last line.
Any ideas?
$query="SELECT PostSubject, FROM postings;";
is invalid sql
try $query="SELECT PostSubject FROM postings";
精彩评论