I have this query:
$sql = "SELECT * FROM tutorials WHERE ( device LIKE '%".$device."%' AND version LIKE '%".$version."%' AND firmware LIKE '%".$firmware."%' ) LIMIT 1";
The table:
device | a, b, c, d
version | 2, 3, 4
firmware | 5
Now I want to have the first string from device(a),version(2) and firmware(5) til the first comma, or if there is no comma the whole text.
I thought of explode(), but I dont really know. I would prefer php, since I want to echo the numbers.
MySQL solution:
PHP solution:
But as being said by Kerrek SB, your should really normalize your table.