0

I would like to get a value of my mysql table. the column name has got numbers.

$temp= array();
$sql = "SELECT `00003A` FROM `table`";
$statement = $mysqli->prepare($sql);
$statement->execute();
$result = $statement->get_result();

while($row = $result->fetch_object()) {

    temp[] = $row->00003A;

}

I get this error:

Parse error: syntax error, unexpected '00003' (T_LNUMBER), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' on line 19

This is line 19:

temp[] = $row->00003A;
csymvoul
  • 677
  • 3
  • 15
  • 30
Trombone0904
  • 4,132
  • 8
  • 51
  • 104

1 Answers1

0

You can try save this value in a variable like:

$prop = '00003A';
     temp[] = $row->$prop;

Or get data with

temp[] = $row['00003A'];
JsMoreno
  • 93
  • 1
  • 6