0

Im struggling with this problem for 3 days since i dont know any coding or regex of etc

i have a wp streaming site with iframe content, the iframe source already in https

now i want to migrate my streaming site to https but when i try to do that, there a lot of movies that cant play, and after i checked, the problem is the iframe url

The movies works ok if the iframe has trailing slash https://example.com/embed/pMVg9liYw9gTvL7/

but without trailing slash, the movies wont load https://example.com/embed/pMVg9liYw9gTvL7

What i want to achieve is to add trailing slash at the end of iframe url from mysql.

please help Thanks

Barmar
  • 741,623
  • 53
  • 500
  • 612
  • 1
    Welcome to StackOverflow! In order for us to help you better, can you please update your question so that it shows your **relevant code** in a [**minimal, complete, and verifiable example**](http://stackoverflow.com/help/mcve). It would also be helpful if you could let us know what you have [**tried so far**](http://meta.stackoverflow.com/questions/261592) to solve your problem. For further information, please refer to the help article regarding [**how to ask good questions**](http://stackoverflow.com/help/how-to-ask), and take the [**tour of the site**](http://stackoverflow.com/tour) :) – Obsidian Age Mar 26 '18 at 23:27
  • Use concat(url, '/') in your select statement. – jose_bacoy Mar 26 '18 at 23:31
  • hi thanks for the replycan u please explain how to ? thanks – Caroline Wirawan Mar 26 '18 at 23:36
  • Can you show your table design ? What columns does it have? What field stores the URL ?? – stackFan Mar 26 '18 at 23:51
  • hi again, the table is wp_postmeta, metakey repeatable_fields, and this is inside meta value a:1:{i:0;a:4:{s:4:"name";s:8:"Server 1";s:6:"select";s:6:"iframe";s:6:"idioma";s:0:"";s:3:"url";s:45:"https://klikfilm.stream/embed/eprN0P0NMh9E6PP";}} – Caroline Wirawan Mar 28 '18 at 19:27

1 Answers1

3

I usually don't like to answer questions that show no attempt, but this one is so simple that it's easier to answer than post complaints.

Use a simple UPDATE statement.

UPDATE yourTable
SET url = CONCAT(url, '/')
WHERE RIGHT(url, 1) != '/'

Replace yourTable and url with the name of your table and the column holding the iframe URL than needs to be fixed.

Barmar
  • 741,623
  • 53
  • 500
  • 612