Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Undefined variable

Status
Not open for further replies.

gapla

Programmer
Dec 15, 2003
37
ES
I get this error:
Notice: Undefined variable: output in c:\archivos de programa\apache group\apache\htdocs\agenda\php-calendar-0.8\php-calendar\includes\display.php on line 137

Some help?
 
This is line 137
Code:
 $output .= "<div id=\"content\">"
and some code around :
Code:
if($i == 0) {
		$output .= "<div id=\"content\">"
		. "<h1>"._('No hay eventos para este día.')."</h1>\n"
		. "</div>";
	} else {
		$output .= "</tbody>\n"
			."</table></div>\n";
		if($admin) $output .= "</form>\n";
	}

	return $output;
}
 
Do you have a line which initialized $output to some value before you concatentate into it? That could be causing your problem.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Yes, i am
Thanks for your help
 
The only thing I see is if you don't get a row from your database $output stays uninitialized. So concatenating something in the following lines would give an error.

Try initializing $output to a zero-length string before requesting a record from the database.

ie.

Code:
$i = 0;
$output = '';
while($row = $db->sql_fetchrow($result)) {

 
Alternatively, as there would be nothing to concatenate if no rows are returned, change line 137 to the assigment operator '=' and not the concatenation operator '.='

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top