开发者

separate a string into multiple queries

开发者 https://www.devze.com 2023-03-19 02:08 出处:网络
Lets say i have a string as so $string = \"12 Days Of Terror\"; and i want to break down this string at each space and insert each word into my DB.

Lets say i have a string as so

$string = "12 Days Of Terror";

and i want to break down this string at each space and insert each word into my DB.

the table: tags

Columns: movie, tagname

Value: 10开发者_如何学编程2, $string

how would you write the query for this?


Just split the string using explode: http://php.net/manual/en/function.explode.php and then insert each tag in the table.

0

精彩评论

暂无评论...
验证码 换一张
取 消