PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
sorry to ask but I am using the following code:
//count number of records
$query="SELECT COUNT(*) FROM Products WHERE category=\"$category_var\" and series=\"$series_var\"";
$result=mysql_query($query);
$row=mysql_fetch_array($result);
$num_records = $row[0];
and when I echo $num_records I get a 0, which isn't right...any thoughts?
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
//count number of records
$query="SELECT COUNT(*) as `count` FROM Products WHERE category=\"$category_var\" and series=\"$series_var\"";
$result=mysql_query($query) or die('Failed on SQL: "'. $query.'". Reason: '. mysql_error());
$row=mysql_fetch_assoc($result);
echo '<pre>';
print_r($row);