Jump to content

i've got "notice"


shikin

Recommended Posts

can someone help me?? currently i'm develop a website using joomla..but then i've got this "notice"

 

 

2.jpg

 

 

this is the coding from sgmenu.php

 

<ul>

<?php

$item_id = (int) mosGetParam($_REQUEST, 'Itemid', 0);

$qry = "SELECT id, name, link FROM #__menu WHERE menutype='mainmenu' and parent='0' AND access<='$gid' AND sublevel='0' AND published='1' ORDER BY ordering LIMIT 10";

$database->setQuery($qry);

$rows = $database->loadObjectList();

foreach($rows as $row) {

echo "<li><a href='$row->link&Itemid=$row->id' ".( $row->id == $item_id ? "class='current'" : "" )." ><span>$row->name</span></a></li>";

}

?>

</ul>

 

 

 

how can i correct this problem??

Link to comment
https://forums.phpfreaks.com/topic/115973-ive-got-notice/
Share on other sites

Edit your php.ini, find this line

 

;error_reporting = E_ALL & ~E_NOTICE

 

and uncomment it like this

 

error_reporting = E_ALL & ~E_NOTICE

 

This will still show all errors and turn off notices

 

If you don't want to turn off notices for everything you can add this code to the top of your index.php

 

<?php

error_reporting(0);

?>

Link to comment
https://forums.phpfreaks.com/topic/115973-ive-got-notice/#findComment-596270
Share on other sites

Disabling error_reporting or lowering the error level doesn't fix the issue. The problem is still there.

can someone help me?? currently i'm develop a website using joomla..but then i've got this "notice"

 

 

2.jpg

 

 

this is the coding from sgmenu.php

 

<ul>

<?php

$item_id = (int) mosGetParam($_REQUEST, 'Itemid', 0);

$qry = "SELECT id, name, link FROM #__menu WHERE menutype='mainmenu' and parent='0' AND access<='$gid' AND sublevel='0' AND published='1' ORDER BY ordering LIMIT 10";

$database->setQuery($qry);

$rows = $database->loadObjectList();

foreach($rows as $row) {

echo "<li><a href='$row->link&Itemid=$row->id' ".( $row->id == $item_id ? "class='current'" : "" )." ><span>$row->name</span></a></li>";

}

?>

</ul>

 

 

 

how can i correct this problem??

The problem is to do with the $gid variable. Where is this variable defined?

Link to comment
https://forums.phpfreaks.com/topic/115973-ive-got-notice/#findComment-596710
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.