Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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