undefined index: why is this occuring and how do I fix it?

Hello:

I have a problem with my php code that is driving me nuts. I am getting an undefined index notice on this line: [php]echo " <input type=“text” name=“column3” value="".$row[‘hca’].""/>\n";[/php]. It seems to be a seemingly random error occuring. What is befuddling me is that the form code to display the data is exactly the same as the previous line and the line after, yet this snippet gets an error/notice. On top of this, the data is not being displayed from the database like it should, even though I have queried the database on the backend and found that the data is indeed there. Why is this occuring and what can I do to fix it? My code is below:

[php]if ($count !== 0) {
while($row = mysql_fetch_array($result)) {
echo “<div class=“addform”><form method=‘get’ action=“update.php”>\n”;
echo " <input type=“text” value="".$row[‘tfid’]."" name=“column1”>\n";
echo " <input type=“text” name=“column2” value="".$row[‘fname’].""/>\n";
echo " <input type=“text” name=“column3” value="".$row[‘lname’].""/>\n";
echo " <input type=“text” name=“column3” value="".$row[‘hca’].""/>\n"; //there are issues here.
echo " <input type=“text” name=“column5” value="".$row[‘file’].""/>\n";
echo " <input type=“image” src=“images/update.png” alt=“Update Row” class=“update” title=“Update Row”>\n";
echo “<a href=“delete.php?column1=”.$row[‘tfid’].”"><img title=‘Delete Row’ alt=“Delete” class=‘del’ src=‘images/delete.png’/>\n";
}
echo “
\n”;
} else {
echo “NO DATA\n”;
}
[/php]

Are you certain ‘hca’ is the column name? Perhaps ‘HCA’?

Sponsor our Newsletter | Privacy Policy | Terms of Service