I know this is a really simple question, but for some reason I just can't get the MySQL "COUNT" thing to work for me. Can someone please show me how to use the count feature (such as mysql_query("COUNT(*) FROM news WHERE id = 5") or something along those lines), then take the result so it can be displayed on the site.
Sorry if this is an elementary problem, my mind has gone blank.






if someone enters "" or "abc", it will just be turned into a 0 which won't cause any problems in the query. you can use the intval() function, like MattR said, or i prefer to type-cast the variable with (int) since it's a bit faster and less to type. 



Bookmarks