Right fix. Wrong reason. mysql will not be looking for table/column names in a value. The error is coming from the fact that the first character is a 1 which means mysql thinks it is a number. 107.218 is okay but adding another dot and oops.
The thing is, the original prepared statement seems like it should work. Be nice to know what the error message was.
It is already a string. I suspect the problem is that you are using emulated prepares though even there I would think it would work. What is the PDO exception message?
I guess I wasn’t thorough enough with my explanation. That is the correct reason. but my example relied on looking at the screen capture and showed syntax more than the exact detailed reason.
MySQL sees the first number as the value, the second as a fractional, upon which it “leaves value mode” and “looks for (field) identifier mode”. In other words, with (a fake IP like) 123.456.789.012 the 123.456 is a presumed float value, but .789.012 is presumed to represent a field.
See the error in the screen capture and notice the " near .57.40"
Surely the PDO parameter substitution deals with quotes, but you’d need to use PDO::PARAM_STR in your bind to convince it?
Not sure how you’d do that if you pass the parameters as an array rather than binding them individually.
ETA - can’t be that, as the doc suggests (well, states categorically) that passing an array into the execute() will treat all members of the array as if they were strings.
Can we see the code you use to actually bind the parameters and execute the query?