Question: For my PHP/MYSQL code , how do I assign certain images and colours to certain values of database arrays in my code below. For example

For my PHP/MYSQL code , how do I assign certain images and colours to certain values of database arrays in my code below. For example the colour red to the name text of "John" and green for "Mary" from Person_Name and a American flag to "New York!" and a French flag to "Paris" from City_Name?

Code is below

City and Persons

$user='root';

$pass='';

$host='localhost';

$db='MyDatabase';

$conn=mysqli_connect($host,$user,$pass,$db);//connect to the server

$result=mysqli_query($conn,"select * from City");

?>

while($mytest=mysqli_fetch_array($result,MYSQLI_ASSOC))

{

?>

}

?>

ID Name

//fetch Person table records

$result=mysqli_query ($conn,'select * from Person');

?>

while ($mytest=mysqli_fetch_array($result,MYSQLI_ASSOC))

{

?>

}

?>

ID Name

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!