1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <link rel="stylesheet" type="text/css" href="search.css" />
<div id="search">
<form method="GET">
<FONT color="black"><input type="search" name="q" id="barre" placeholder="Rechercher un jouet..." style="width: 303px;border-radius: 50px;height: 25px;text-decoration: none;border: 0; color: #000000; font-size: 15px;"></FONT></div>
<input type="submit" value="Valider" />
</form>
<?php
$bdd = new PDO('mysql:host=localhost;dbname=toysgroup', 'root', 'root');
?>
<?php
$q = $_GET['q'];
$sql = $bdd->prepare('SELECT toys, id FROM shop WHERE toys LIKE :reference ORDER BY id DESC');
$sql->bindValue('reference', '%' . $q . '%');
while($data = $sql->fetch())
{ ?>
<label for="resultstyle"><div class="result"><li><a href="toys.php?id=<?php echo $data['id']; ?>&toys=<?php echo $data['toys']; ?>" style="text-decoration: none;"><img src="/images/toys/ball.png/" style="no-repeat center center/100% white; border-radius: 50%; display: inline-block; float: left; border: 3px solid #19c589; padding: 3px; -webkit-border-radius: 150px; width: 20px; height: 20px; vertical-align : middle; margin-top: 4px;" /><FONT color="white" style="margin-top: 5px;"><div id="datatoys" style="margin-top: 8px; margin-left: 5px; float: left;"><?php echo $data['toys']; ?></div></FONT></a></li></div></label>
<?php }
?>
</ul>
</div> |
Partager