function countsearch($id){
	  $db = NULL;
	  $db = new MyDBHandler;
	  $db -> init();

	  $db -> OpenConnection();
	  $sql="select id,count(keywords) from seeker where userid=".$id;

	  $result = $db->Select($sql);
	  
	  $db -> CloseConnection();
	  return $result;
	}

$nos=$db->countsearch($id);

if it is a ordinary field i will print it as echo $nos[0]["id"]
can anybody tell how to print a count variable...i want to store the count and print it in php

Recommended Answers

All 2 Replies

Modify the query to assign the count number to the kwcount column:

$sql="select id,count(keywords) AS kwcount from seeker where userid=".$id;

You can then retrieve kwcount in the same way that you retrieve the id column.

can u quote some example i am not able to get you
thanks for your reply

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.