Hey everyone,
I'm new to the forum (as well as php), and I'm looking for a bit of help on a blog-like solution I'm trying to build up. On my front page I have three columns (technology, music, and movies) and I would like to have the php pull the content out of the mysql database and display it on my website.. Which I've been able to successfully do.
However I have a field in my mysql database called disclude_categories which is numeric and what I would like to have is when it is set to 1 it doesn't show up on my front page. I thought that maybe I could include it on my while loop, but can't seem to get it to work.
Here's the code that I have so far:
Code:
mysql_connect($host,$user,$pass) or die("ERROR:".mysql_error());
mysql_select_db($database) or die("ERROR DB:".mysql_error());
$query = "select * from blog WHERE categories='Technology' ORDER BY date DESC";
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_assoc($result)) {
echo $row['content']; }
|