You can call the mysql_stmt_param_count() function to return the number of parameters that exist in a prepared statement.
Syntax
unsigned long
mysql_stmt_param_count(MYSQL_STMT *stmt)
Return values
An unsigned long integer that indicates the number of parameters in the statement is returned.
Errors
None.