title: inner join with php the browser display a syntax error
body: <p>I have a select query with inner join. I try it in phpmyadmin it works fine. But when I try it in the browser it display this error message:</p>
  
  <blockquote>
    <p>You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use
    near 'SELECT s.specialization_name FROM user u INNER JO' at line 1</p>
  </blockquote>
  
  <p><strong>member_search.php</strong></p>
  
  <pre><code>/default  message  on top of the result  display
  $querySrting="WHERE registered_date!='' ORDER BY registered_date ASC ";
  $queryMSG="Showing newest to oldest memebrs by default";
  ///IF STATMENT TO DISTINGOUICH SEARCHING
  if(isset($_POST['listbyq']))
  {
    if($_POST['listbyq']=="newest_members")
    {
        $querySrting="WHERE registered_date!='' ORDER BY registered_date DESC " or die(mysql_error());
        $queryMSG="Showing senior to oldest memebrs";
    }
  elseif($_POST['listbyq']=="by_specialization")
  
     {
        $querySrting="SELECT specialization_name FROM members u 
                           INNER JOIN specialization s 
                                       ON u.specialization=s.specialization_id";
  
      $result = mysql_query($querySrting)  or die(mysql_error());
        $queryMSG="showing members with specs";
     }
  elseif($_POST['listbyq']=="by_firstname")
    {
        $fname = $_POST['fname'];
        $fname = stripcslashes($fname);
        $fname = strip_tags($fname);
        $querySrting="WHERE  first_name LIKE '%$fname%'"or die(mysql_error());
        $queryMSG="Showing member with the name you searched for";
    }
  }
  ///******query the member data using the queryString*******//
  $sql = mysql_query("SELECT user_id, first_name, last_name, birth_date, specialization, registered_date FROM members $querySrting") or die(mysql_error());
   //**********************outputlist*********************************//
   $outputlist="";
   while($row = mysql_fetch_array($sql))
   {
       $id=$row['user_id'];
       $firstname=$row['first_name'];
       $lastname=$row['last_name'];
       $birthdate=$row['birth_date'];
       $spec = $row['specialization'];
       $registereddate=$row['registered_date']; 
       ////***********for the upload image*************************//
        $check_pic="members/$id/image01.jpg";
     $default_pic="members/0/image01.jpg";
     if(file_exists($check_pic))
     {
         $user_pic="&lt;img src=\"$check_pic\"width=\"120px\"/&gt;";
     }
     else
     {
         $user_pic="&lt;img src=\"$default_pic\"width=\"120px\"/&gt;";
     }
  
     $outputlist.='
     &lt;table width="100%"&gt;
                 &lt;tr&gt;
                    &lt;td width="23%" rowspan="3"&gt;&lt;div style="height:120px;overflow:hidden;"&gt;&lt;a href = "http://localhost/newadamKhoury/profile.php?user_id='.$id.'" target="_blank"&gt;'.$user_pic.'&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
                    &lt;td width="14%"&gt;&lt;div  align="right"&gt;Name:&lt;/div&gt;&lt;/td&gt;
                    &lt;td width="63%"&gt;&lt;a href = "http://localhost/newadamKhoury/profile.php?user_id='.$id.'" target="_blank"&gt;'.$firstname.' '.$lastname.'&lt;/a&gt;&lt;/td&gt;
                    &lt;/tr&gt;
  
                    &lt;tr&gt;
                      &lt;td&gt;&lt;div align="right"&gt;Birth date:&lt;/div&gt;&lt;/td&gt;
                      &lt;td&gt;'.$birthdate.'&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                     &lt;td&gt;&lt;div align="right"&gt;Registered:&lt;/div&gt;&lt;/td&gt;
                     &lt;td&gt;'.$registereddate.'&lt;/td&gt;
                    &lt;/tr&gt;
  
                    &lt;tr&gt;
                     &lt;td&gt;&lt;div align="right"&gt;His Job:&lt;/div&gt;&lt;/td&gt;
                     &lt;td&gt;'.$spec.'&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;/table&gt;
                    &lt;hr /&gt;
            ';
  
   }//close while
  </code></pre>