Error in the database query, namely the wrong syntax

Error in

WHERE surname=’$surname_parent'”);because if you write

WHERE surname=’Bukharova'”);then finds

$result = mysql_query("SELECT name, surname, class_str, class_int FROM datacenter                         WHERE surname='$surname_parent'");
$count = mysql_num_rows($result);
for ($i = 0; $i < $count; $i++) {
    $row = mysql_fetch_array($result);
    echo '<li>';
    echo $row['class_int'];
    echo '</li>';
}
if ($result) {
    echo '';
} else {
    echo '';
}

Answer 1, authority 100%

Do a var_dump( $surname_parent )before the request

P.S: I would at least rewrite the code like this:

$result = mysql_query('
   SELECT name, surname, class_str, class_int
   FROM datacenter
   WHERE surname="'.$surname_parent.'"
');
if ( $result == false ) echo ' ';
else {
  if ( mysql_num_rows($result) == 0 ) echo '  ';
  else{
    while ( $row = mysql_fetch_array($result) ){
        echo '<li>'.$row['class_int'].'</li>';
    }
    echo '';
  }
}