I can’t seem to perform the proper selections from mySQL data.
$sort = $_GET['sort'];
// ...
$sql = "SELECT id, title, genre, format, year FROM dvd WHERE format LIKE '$sort%'";
$result = mysql_query($sql, $link);
<ul class="grid">
<?php
while ($row = mysql_fetch_assoc($result))
{ ?>
...
where $sort = 'dvd'
However, when i tried to do it manually,
SELECT id, title, genre, format, year FROM dvd WHERE format LIKE 'dvd'
i was able to obtain results using phpmyadmin -> mySQL -> SQL.
Why is it that i won’t be able to get data whenever i choose format?
I tried this for other columns such as genre and title and i was able to get the result that i want. The columns were all structured to be the same VARCHAR and same settings
the word “format” might be a keyword which is conflicting… change the column name “format” to something else… It will work…