I searched the forum and the internet, but I could not solve the problem yet! I am doing a query in the bank by PHP and looking for users. After searching the users I look for his academic formations within that other search (since there may be more than one) with this the second while it works only on the first user, the second on it looks like "to".
Here are my codes:
Search for users
$query_busca_prof = "SELECT * FROM tags, user WHERE tag_tag LIKE '%$busca%' AND tag_user = user_id"; $Busca_busca_prof = mysql_query($query_busca_prof, $bd) or die(mysql_error()); $row_busca_prof = mysql_fetch_assoc($Busca_busca_prof); $totalRows_busca_prof = mysql_num_rows($Busca_busca_prof);
Print Users and Training
do { $query_busca_forma = "SELECT * FROM user_prof_forma WHERE user_prof_forma_user = '".$row_busca_prof['user_id']."'"; $Busca_busca_forma = mysql_query($query_busca_forma, $bd) or die(mysql_error()); $row_busca_forma = mysql_fetch_assoc($Busca_busca_forma); $totalRows_busca_forma = mysql_num_rows($Busca_busca_forma); echo $row_busca_prof['user_nome']; do { echo $row_busca_forma['user_formacao']; } while ($row_busca_forma = mysql_fetch_assoc($Busca_busca_forma)); // este que não funciona } while($row_busca_prof = mysql_fetch_assoc($Busca_busca_prof));
Thank you for your attention!