I’ve got a table field membername which contains both the last name and the first name of users. Is it possible to split those into 2 fields memberfirst, memberlast?
All the records have this format “Firstname Lastname” (without quotes and a space in between).
Unfortunately MySQL does not feature a split string function. However you can create a user defined function for this, such as the one described in the following article:
With that function:
you would be able to build your query as follows:
If you prefer not to use a user defined function and you do not mind the query to be a bit more verbose, you can also do the following: