Undefined offset

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
HG
Forum Newbie
Posts: 18
Joined: Mon Jun 10, 2002 11:40 am
Location: sweden
Contact:

Undefined offset

Post by HG »

how do I fix a problem with Undefined offset???

the line looks like this

if ($record[$recno]):
Zmodem
Forum Commoner
Posts: 84
Joined: Thu Apr 18, 2002 3:59 pm

Post by Zmodem »

chances are, $recno has no value. Make sure it is set to something.

You might also try placing double quotes around $recno.

Thats the best I can do without seeing some code ;)
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

it seems quite often that you have problems with your arrays/hashes.
use print_r($name_of_array>); to take a look on it's content to be sure it contains what you are trying to access. if the index is a variable do also print this var.
Post Reply