I have a table with a request log. In there is a column with referers. Now in order to see what domains refer the most requests I want to add a new column with the host of the referer.
That is no problem for the new entries but how do I update every row without an entry in the new row to have the host from the referer?
Is there an easy way to do this in MySQL or how di I solve it in PHP?
This php code fetch all the rows with empty
host_reffield,then it takes the host (www.domain.com) from the
url_ref(www.domain.com/page/34.html) with theparse_urlfunction.After that , there’s an
updatequery which updates the host field.NOTICE: Customize this code according to your db scheme.