Jump to content

PravinS

Members
  • Posts

    459
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by PravinS

  1. try using GROUP BY clause  like this

     

    SELECT course.courseTitle, COUNT(DISTINCT student.sex)
    FROM course, student
    WHERE student.sex = 'f' GROUP BY course.courseTitle
  2. try using this function

    function sort_array($array, $key, $order)
    	{
    		if ($order=="DESC")
    			$or="arsort";
    		else
    			$or="asort";
    		for ($i = 0; $i < sizeof($array); $i++) 
    		{
    			$sort_values[$i] = $array[$i][$key];
    		} 
    		$or($sort_values);
    		reset ($sort_values);
    		while (list ($arr_key, $arr_val) = each ($sort_values)) 
    		{
    			$sorted_arr[] = $array[$arr_key];
    		}
    		return $sorted_arr;
    	}
    
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.