1
Kerjin
undefined constant
  • 2004/6/6 16:50

  • Kerjin

  • Just popping in

  • Posts: 48

  • Since: 2004/3/10


Can anyone help me with this error: Notice [PHP]: Use of undefined constant num_boxes - assumed 'num_boxes' in file modules/lcas/blocks/lcas.php line 14

I'm new to XOOPS module programming, sorry if this is obvious. Here is the affected code:

Quote:

<?php

function letterbox_show($options){
global $xoopsDB;

// Pick total number of boxes listed
$count = 0;
$sql = "select * from ".$xoopsDB->prefix('box_info')."";
$result = $xoopsDB->query($sql);
while($row = $xoopsDB->fetchArray( $result)) {
$sql1 = "select num_boxes from ".$xoopsDB->prefix('box_info')." where boxid = '$row[boxid]'";
$result1 = $xoopsDB->query($sql1);
while($row1 = $xoopsDB->fetchArray( $result1)) {
$count = $count + $row1[num_boxes];
}
}


Line # 14 is this one: $count = $count + $row1[num_boxes];

The block is working just fine, it's that I get this error when PHP Debug is one and, well, being anal about things like this, even though I can 'mute' it I want to know why it's giving me that error.

Any help is greatly appericated.

2
Mithrandir
Re: undefined constant

use $row1['num_boxes']; (with single or full quotes) and you should get rid of the debug msg.

3
Kerjin
Re: undefined constant
  • 2004/6/6 18:41

  • Kerjin

  • Just popping in

  • Posts: 48

  • Since: 2004/3/10


That did it, thanks much!!!!

Login

Who's Online

160 user(s) are online (89 user(s) are browsing Support Forums)


Members: 0


Guests: 160


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits