Kev0121
03-06-2009, 05:13 PM
Well heres my code
<?php
$con = mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('blog',$con);
$query = "SELECT * FROM `content` WHERE ID = `1`";
$res = mysql_query($query);
$post = mysql_num_rows($res);
echo "<h1>" . $post['title'] . "</h1>";
echo "<h3>" . $post['date'] . "</h3>";
echo "<p>" . $post['content'] . "</p>";
?>
and heres my error
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\wamp\www\tests\Variables.php on line 8
Kevin
<?php
$con = mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('blog',$con);
$query = "SELECT * FROM `content` WHERE ID = `1`";
$res = mysql_query($query);
$post = mysql_num_rows($res);
echo "<h1>" . $post['title'] . "</h1>";
echo "<h3>" . $post['date'] . "</h3>";
echo "<p>" . $post['content'] . "</p>";
?>
and heres my error
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\wamp\www\tests\Variables.php on line 8
Kevin