Illegal string offset 'x' in

I have a warning and a notice that appear with the line of code below -

<input type="hidden" name="srno1" value="<?php echo $d1["Id_Eve"] ?>">

PHP Warning: Illegal string offset ‘Id_Eve’ in
PHP Notice: Uninitialized string offset: 0 in

Im not sure what it means

The most likely cause is that $d1[“Id_Eve”]; does not hold a value.

<?php echo isset($d1["Id_Eve"]) ? $d1["Id_Eve"] : NULL; ?>

would get rid of the error, but not knowing what you’re going after that might not be what you’re looking for?

Ah ye that might be it, its probably empty as the page loads and only becomes a value once somehting has been selected to be edited and then a value gets filled in there.

I get a similar error with below, would it be the same answer as you gave

<?php if ($result2['total1'] == "0") { ?>

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.