How to add in <style> CSS php echo
Posted: 28 Oct 2021, 15:02
Dear Coursesweb, Hope you do all fine
I can not find out how to add in the <style> a result from my database.
Hope to get some support for this. `thanks`
I can not find out how to add in the <style> a result from my database.
Hope to get some support for this. `thanks`
Code: Select all
<?php
include('../connection1.php');
$id = (int) $_GET['id'];
$sql=mysqli_query($connmaker,"SELECT * FROM `maker` WHERE post_id='" . $id . "' ");
$users=mysqli_fetch_assoc($sql);
?>
<style>
body {
font-family: "Exo 2", sans-serif;
display: flex;
justify-content: center;
align-items: center;
background: <?php echo $users['bbgcolor'];?>;
min-height: 100vh;
}
</style>