Want to remove everything after the .com address in a mysql table ... Suppose

Sample Before:
domain.com/friend

Sample After:
domain.com

Here is a basic example of how you could do it using substring_index

UPDATE Table SET column = SUBSTRING_INDEX(column, '/', 1);

This doesn't take into account of the url having a protocol. It just gets everything before the first '/', but this should give an idea on where you can start.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.