/ Published in: PHP
URL: http://mneary.info/home/search.php
I thought this was pretty elegant code and wanted to share it with anyone who found it useful.
Expand |
Embed | Plain Text
$query = $search ? ( !$cat ? "SELECT * FROM games WHERE name LIKE '%".$search."%'" : "SELECT * FROM games WHERE category='".$cat."' AND name LIKE '%".$search."%'" ): ( $cat ? "SELECT * FROM games WHERE category='".$cat."'" : "SELECT * FROM games WHERE name='N/A'" ); basic_connect($query);
You need to login to post a comment.
