Page 1 of 1

Values not getting

Posted: Wed May 02, 2007 4:24 am
by kpraman

Code: Select all

class MyCalendar extends Calendar
{
public $ms_ID;  [b]value not getting assigned[/b]    function getCalendarLink($month, $year)
    {
        // Redisplay the current page, but with some parameters
        // to set the new month and year
        $s = getenv('SCRIPT_NAME');
        return "$s?month=$month&year=$year";
		
    }

    function getDateLink($day, $month, $year)
    {
		$query=mysql_query("SELECT * FROM temp_course_dates");
		if(mysql_num_rows($query)==0){
		$query=mysql_query("SELECT * FROM on_site_course_date");
		}
		
		[b]echo $this->ms_ID; //Value Not coming[/b]

...............


$cal=new MyCalendar;
$calId=new MyCalendar;
$cal=$cal->getMonthView($month, $year);

//echo $ms_details_id=1;
$calId->ms_ID=$ms_details_id;


I am not getting the values.

Posted: Wed May 02, 2007 6:38 am
by onion2k
You're not assigning a value to $ms_ID anywhere.

Posted: Thu May 03, 2007 4:36 am
by kpraman
I am assigning

Code: Select all

$calId->ms_ID=$ms_details_id;

Posted: Thu May 03, 2007 5:12 am
by onion2k
You've commented out the line where you echo and assign a value to $ms_details_id though. So $ms_details_id is going to be empty. Furthermore, you're not calling getDateLink() anywhere, so how do you expect it to display anything?