I would like to create a list of actors.
Actors added to database in this way Jhone Jhones, Tom Boras and e.t.c..
All actors in one line in database separated with ","
| And I have result:
Roles: Jhone Jhones, Tom Boras
The idea is to create a separate PHP file with a list of actors which will be used like:
IF Jhone Jhones replace with <img src="roles/JhoneJhones.jpg" >
Thank you.
This is what I have (ONLY IDEA):
DO NOT KNOW how to get information from $row['vidRoles'] and insert it to array. This one question.
$array = array("Jhone Jhones","Tom Boras");
Then:
IF index[0] == to Jhone Jhones{
replace(index[0] to <img src="roles/JhoneJhones.jpg">
}
EDIT:
I have this idea:
$query = "SELECT vidRoles FROM videoinformation";
if ($result = mysqli_query($con, $query)) {
while ($row = mysqli_fetch_row($result)) {
printf ("<img src=\"roles/%s.jpg\>", $row[0]);
}
mysqli_free_result($result);
}
In one (each)vidRole field in database, I have all together divided with comma Name1,Name2,Name3.
How using this code which I showed before, take each field divided each field like:
From Name1,Name2,Name3 to:
Name1
Name2
Name3
I mean separate variables.
Finally what I need using Name1,Name2,Name3 to:
<img src="roles/Name1.jpg>
<img src="roles/Name2.jpg>
<img src="roles/Name3.jpg>