$ip_sql=mysql_query("select ip_id from vote_ip where mes_id_fk='1' and ip_add='$ip'"); $count=mysql_fetch_array($ip_sql);
In general, it is necessary for select
take 10 ip_id
, where mes_id_fk=
from 1 to 10.
select ip_id from vote_ip where (mes_id_fk BETWEEN 1 AND 10) and ip_add='$ip'
or
select ip_id from vote_ip where mes_id_fk < 10 and ip_add='$ip'
$ip_sql=mysql_query("select ip_id from vote_ip where mes_id_fk IN('1','2','3','4','5','6','7','8','9','10') and ip_add='$ip' LIMIT 10"); $count=mysql_fetch_array($ip_sql);
Something hardly understood the question, but! In the mysql_query query, add such things as ORDER BY
and LIMIT
. The output of data to carry out through the cycle:
while($count=mysql_fetch_array($ip_sql)) { echo $count['И нужное поле из бд']; }
PS Or I did not understand well)
IP(ip_add)
, but different mes_id_fk
. Moreover, mes_id_fk
strictly defined. In general, it is necessary for voting to know if the user answered the given question. - Ruslan Librovsky SeptemberSource: https://ru.stackoverflow.com/questions/38606/
All Articles