Cita:
Iniciado por Sourcegeek
Puedes hacer esto:
Selecciona TODOS los datos de Mysql.
Recorre los datos con un bucle
while haciendo un condicional: Si el registro actual es igual a cualquier dato, hay que mostrarlo.
En resúmen, puede ser algo así:
Código PHP:
while ($res = mysql_fetch_assoc($query)) {
if (array_search($res['artista'], $preg_match)) {
echo $res['artista'];
}
}
Pero claro, tu debes adaptarlo a como lo necesites, yo sólo aporté con la idea.
Saludos!
hola, lo hice de esta forma:
Código PHP:
$artista = $salida[1][$i];
$consulta = "SELECT artista FROM artistas WHERE artista = '".$artista."'";
$resul = mysql_query($consulta);
while ($res = mysql_fetch_assoc($resul)) {
if (array_search($artista, $res['artista'])) {
@mysql_query("INSERT INTO artistas(id,genero,artista,Hits)VALUES(NULL, '".str_replace("_"," ",$generoo)."', '".str_replace("ñ","n",str_replace("_"," ",$artista))."', 0)");
echo '<a href="index.php?genero='.$generoo.'&artista='.$artista.'" target="zonaflow">'.str_replace("_"," ",$artista).'</a><br>';
}else{
echo "asd";
}
}
pero al usarlo me da este error:
Cita: Warning: array_search() [function.array-search]: Wrong datatype for second argument in /home/fullsoni/public_html/musiks/agregadas/index.php on line 208
que estare haciendo mal?? gracias!