Hey all,
I have a record stored in my table that, on the first line of a column, has a specific piece of data I want to collect and separate from the rest of the column. I was thinking of doing the following but not sure if it will work. If anyone knows a better way, by all means help!
$query = "SELECT `columnA`, `columnB` FROM `table` WHERE `id` = mysql_real_escape_string($_GET['id'])";
$result = mysql_query($query);
$record = mysql_fetch_assoc($result);
$find = strpos($record['columnA'], "\n");
$wanted = substr($record['columnA'], 0, $find);
Basically this looks for the first line break and gets the character at which it occurs. It would then store everything up to the line break in the $wanted variable. Will this work?