Novo

Forum kao aplikacija na telefonu

Dodajte forum na početni ekran i koristite ga kao aplikaciju, sa menijem na dnu ekrana.

mysql_affected_rows() or mysql_num_rows() for select statment

mysql_affected_rows() or mysql_num_rows() for select statment 21.10.2011. u 11:10 · pre 183 meseca #1
Navikao sam da radim ovako:
Code:
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().

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?
Re: mysql_affected_rows() or mysql_num_rows() for select statment 21.10.2011. u 16:03 · pre 183 meseca #2
1.
int mysql_affected_rows ([ resource $link_identifier ] )
Get the number of affected rows by the last INSERT, UPDATE, REPLACE or DELETE query associated with link_identifier.


2.
int mysql_num_rows ( resource $result )
Retrieves the number of rows from a result set. This command is only valid for statements like SELECT or SHOW that return an actual result set. To retrieve the number of rows affected by a INSERT, UPDATE, REPLACE or DELETE query, use mysql_affected_rows().
Potpis
[Ovu poruku je menjao VladaSu dana 14.06.2003. u 11:22 GMT+1]
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme