$list_query = mysql_query("SELECT DISTINCT(`name`) FROM list WHERE approved = 'yes' ORDER BY name");
while($list_get = mysql_fetch_array($list_query))
$list_query_again = mysql_query("SELECT * FROM `list` WHERE name = '$list_get[name]' AND approved = 'yes'");
$list_get_again = mysql_fetch_array($list_query_again);
$report_query = mysql_query("SELECT * FROM `list` WHERE name = '$list_get[name]' AND approved = 'yes'");
$report_count = mysql_num_rows($report_query);
This is an extract from my code. When it echos the names, if it get to a name called "Gojita'Mu" with an apostrifie(?) in it, it causes an error. Is their any way of solving this? I've tried to rearrange " to ' and vice versa, but I got nothing.
Edit, my cpanel info says im on version 4.0.23-standard mysql
It's just selecting some "reports" in a table. Each report has a name date etc and weather or not if its been approved. Because its in one table many reports could be the same name, so I made it select only 1 and echo the name.