I been playing with adding genre to the database pulled from imdb. I have this code
It works as long as the genre is listed like horror, thriller, action, because it sees the comma then returns the string in front of the comma, but if no comma exists, then nothing gets pulled. Is there a batter way to do this?
if ($row["genre"]='NULL'){
$str = strstr($_data->Genre, ',', true);
SQL_Query_exec("UPDATE `torrents` SET `genre` = '".mysqli_real_escape_string ($GLOBALS["DBconnector"],$str). "' WHERE `id` = $id");
}It works as long as the genre is listed like horror, thriller, action, because it sees the comma then returns the string in front of the comma, but if no comma exists, then nothing gets pulled. Is there a batter way to do this?
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
