Code:
mysql_query("SELECT blablabla");
if(mysql_affected_rows()>0){
something is found, proceed
}else{
nothing is found
}
mysql_query("SELECT blablabla");
if(mysql_affected_rows()>0){
something is found, proceed
}else{
nothing is found
}
Manual kaze
Citat:
Note: SELECT Statements
To retrieve the number of rows returned by a SELECT, it is possible to use mysql_num_rows().
To retrieve the number of rows returned by a SELECT, it is possible to use mysql_num_rows().
Meni mysql_affected_rows() uvek, ali uvek vraca >0 ako je nesto nadjeno. A koristim ga bas mnogo. Sad, zanima me koliko je pogresno ovo raditi, i da li ima bolji nacin za proveru da li je nesto nadjeno u bazi od ovog mog koda?