Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting in Dreamweaver with PHP and mySQL

Status
Not open for further replies.

eraserr

Programmer
Sep 12, 2002
2
SI
I get error:
"Warning: Supplied argument is not a valid MySQL result resource in.."

But I don't think there should be any error in code below.

Thank you for your help!

thread
******
id
topic
title


SOURCE:
$my_sql_string_count = "
SELECT COUNT(id) AS counter
FROM thread
WHERE topic = 1
";

$result_count = mysql_query ($my_sql_string_count);
$row_count = mysql_fetch_row ($result_count);
echo $row_count["counter"];
 
Sorry for bothering you, I forgot something so obvious, that I did't find problem so soon. I forgot to include connection to base before sql_string...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top