php - Count Rows MySQL -


[i know mysqli new standard , in process of updating, have questions old standard.]

i trying count number of rows match query, add number it.

$findtypes = "select * _products product_type = '$producttype'"; $querytypes = mysql_query($findtypes, $db_products); $numtypes = mysql_num_rows($querytypes); $productid = $numtypes + 100; 

if there existing product-type in database, there should return result of 101, if there 2 102, etc.

as stands doesn't work... not sure why.

thanks,

your query wrong, have no from statement...

try:

select * _products product_type = '$producttype'


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -