Main topic: https://stackoverflow.com/questions/35163890/you-have-an-error-in-your-sql-syntax-check-the-manual-that-corresponds-to-your?sfb=2
SELECT SUBSTRING(LEFT(configuration, LOCATE('abhol_firma', configuration) -30), LOCATE('treuhand_betrag', configuration) +22, 100) FROM tl_iso_product_collection_item WHERE LOCATE('abhol_firma', configuration) > 0 AND LOCATE('treuhand_betrag', configuration) > 0 ORDER BY id DESC LIMIT 1
So basically I need to implement this code into a PHP file and display the result. My code so far looks like this:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$connection = mysqli_connect('localhost', 'user', 'pw', 'db');
$query = "SELECT SUBSTRING(LEFT(configuration, LOCATE('abhol_firma', configuration) -30), LOCATE('treuhand_betrag', configuration) +22, 100) FROM tl_iso_product_collection_item WHERE LOCATE('abhol_firma', configuration) > 0 AND LOCATE('treuhand_betrag', configuration) > 0 ORDER BY id DESC LIMIT 1";
$result = mysqli_query($connection, $query);
if($result === FALSE) {
echo mysqli_error($connection);
} else
while($row = mysqli_fetch_array($result)){
echo $row['configuration'];
}
mysqli_close($connection);
?>
The tl_iso_product_collection_item table: http://puu.sh/mUf65/b1498aa7fa.png
Structure: http://puu.sh/mUf78/f25448e1d7.png
Whenver I try to execute this the following message appears:
Notice: Undefined index: configuration on line 12
I tried literally everything and I just don't know where the problem may be. Can anyone help out? Thanks in advance.