mysql - Show the result from query database php -


i have code this:

$genre = 'jazz'; $what_genre = mysql_real_escape_string($genre); $query = mysql_query("select song.id, song.title, genre.genre song inner join genre on song.id_genre=genre.id_genre genre.genre = '" .$what_genre. "' order id");  if(mysql_num_rows($query) > 0) {     while($result = mysql_fetch_array($query))     {         echo $result['id'];         echo $result['title'];         echo $result['genre'];     } } 

i want show result, failed. system give me error report:

a php error encountered

severity: warning

message: mysql_num_rows() expects parameter 1 resource, boolean given

what should do? help.

change query id song.id this

"select song.id, song.title, genre.genre song inner join genre on song.id_genre=genre.id_genre genre.genre = '" .$topiknya. "' order song.id"; 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -