Values not getting

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kpraman
Forum Contributor
Posts: 172
Joined: Fri Oct 13, 2006 10:54 am

Values not getting

Post 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.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

You're not assigning a value to $ms_ID anywhere.
kpraman
Forum Contributor
Posts: 172
Joined: Fri Oct 13, 2006 10:54 am

Post by kpraman »

I am assigning

Code: Select all

$calId->ms_ID=$ms_details_id;
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post 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?
Post Reply