What does this mean?
Can we also see the code you are running that creates this error?
Student Information
<div class="row">
<div class="col-lg-6">
<H4>Student details</H4>
<table class="table" align="center" >
<tbody>
<tr>
<td><strong>Student Name:</strong> <?php echo (isset($cur)) ? $cur->LNAME.', '.$cur->FNAME.', '.$cur->MNAME : 'STUDENT NAME' ;?><br/>
<?php
if (isset($cur->SEX) == 'M'){
echo '<strong>Gender:</strong>Male<br/>';
}
elseif (isset($cur->SEX) == 'F'){
echo '<strong>Gender:</strong>Female<br/>';
}
?>
<strong>Age:</strong> <?php echo (isset($cur)) ? $cur->AGE : 'AGE' ;?><br/>
<strong>BIRTH DATE:</strong> <?php echo (isset($cur)) ? $cur->BDAY : 'BIRTH DATE' ;?><br/>
<strong>STATUS:</strong> <?php echo (isset($cur)) ? $cur->STATUS : 'STATUS' ;?><br/>
<strong>EMAIL:</strong> <?php echo (isset($cur)) ? $cur->EMAIL : 'EMAIL' ;?></td>
</tr>
</tbody>
</table>
</div>
Enrollment details
<tbody>
<tr>
<td><strong>Course/Yr:</strong> <?php echo (isset($sy)) ? $sy->COURSENAME : 'COURSENAME' ;?><br/>
<strong>Academic Year:</strong> <?php echo (isset($sy)) ? $sy->AY : 'AY' ;?><br/>
<strong>Semester:</strong> <?php echo (isset($sy)) ? $sy->SEMESTER : 'SEMESTER' ;?><br/>
<strong>Category:</strong> <?php echo (isset($sy)) ? $sy->CATEGORY : 'CATEGORY' ;?><br/>
<strong>STATUS:</strong> <?php echo (isset($sy)) ? $cur->STATUS : 'STATUS' ;?></td>
</tr>
</tbody>
</table>
</div>
</div>
I think the file with the error may be the one that does the database query. eg. the Database::$FNAME
error messages.
That is, for some reason the query is not assigning the values to the object.
Agreed with @Mittineague. I feel like the variable that holds the object value isn’t really an object. What I always do is <pre><?php print_r($variable); ?></pre>
before I start assigning property names to anything. If that line of code doesn’t give me the object or result I expect, I don’t ever continue. No matter what I already have done and want to get done, I won’t move further until that line of code gets me the results I want. I can verify that it works by making sure the data that’s being returned is the exact ones from the row I am looking at.
this is the database query i did, but i dont know if i did it right im.
<?php
$mydb->setQuery("SELECT `SYID`, `AY`,`SEMESTER`, schoolyr.`COURSE_ID`, `IDNO`, `CATEGORY`, `DATE_RESERVED`, `DATE_ENROLLED`, `STATUS`, `STUDENTNAME`,CONCAT(`COURSE_NAME`,'- ', `COURSE_LEVEL`) as 'COURSENAME' FROM `schoolyr` LEFT JOIN course ON schoolyr.COURSE_ID = course.COURSE_ID WHERE `AY`='{$_SESSION['AY']}' AND SEMESTER='{$_SESSION['SEMESTER']}' AND IDNO={$_SESSION['ACCOUNT_ID']}");
$sy = $mydb->loadSingleResult();
$cur = $mydb
?>
Yeah, there’s a problem with that. Unless we know what $mydb
class contains, we really can’t figure out what you’re supposed to return. Can you provide the class for it and the correct line for $cur
? Only have only provided the $mydb
variable, but not the method you are trying to use.
$mydb = new Database();
this is the content of the $mydb
I’m talking about the class that $mydb
is using. We need to know what methods you are trying to use.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.