Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
check ID u bazi

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
liban0n



Joined: 10 Feb 2004
Posts: 128
Location: Dubrovnik, Zagreb

PostPosted: 19.03.2005 12:59    Post subject: check ID u bazi Add user to your forum ignore list Reply with quote

Zasto mi ne vraca u redu!!

Code:

function ImaliGa($id)
{
$query = "SELECT id FROM $this->table WHERE id='$id' and active='T'“;
$goni = $this->baza($query);

if($goni) {
if (mysql_num_rows($goni) === 0) {
return false;
}
else {
return true;
}
}
else {
return false;
}
}

I u kodu negdje imam

$provjeri = $moja->ImaliGa($id);

If ($provjeri == false) {
// nesto
}

Else {
// nesto

}



Ovo mi provjerava kad mi netko napise los uid preko urla – i odmah zelim da provjerim dali taj postoji

E kad ovaj id postoji uredno vrati true ili ti ga 1 ... ali kad ga nema Results=0 ... ne vrati pa skoro ništa
Probao sam query i rucno .. kad je ne postojeci ID vrati Empty ... i to bi trebalo raditi ali jednostavno nece!!!! Sad

Di moja malenkost griješi

_________________
mount -t swap /dev/brain /mnt/head
look'n for a job
Back to top
View user's profile Send private message Visit poster's website
budha



Joined: 02 Mar 2004
Posts: 1377
Location: Osijek

PostPosted: 19.03.2005 15:15    Post subject: Re: check ID u bazi Add user to your forum ignore list Reply with quote

jel si ovo krivo prepisao, ili je to code?
Quote:
if($goni) {
if (mysql_num_rows($goni) === 0) {
return false;
}

_________________
I hate to advocate drugs, alcohol, violence, or insanity to anyone, but they've always worked for me.
Back to top
View user's profile Send private message Visit poster's website
liban0n



Joined: 10 Feb 2004
Posts: 128
Location: Dubrovnik, Zagreb

PostPosted: 19.03.2005 21:19    Post subject: Add user to your forum ignore list Reply with quote

to je kod. a zašto ???

_________________
mount -t swap /dev/brain /mnt/head
look'n for a job
Back to top
View user's profile Send private message Visit poster's website
liban0n



Joined: 10 Feb 2004
Posts: 128
Location: Dubrovnik, Zagreb

PostPosted: 19.03.2005 21:59    Post subject: Add user to your forum ignore list Reply with quote

u glavnom sad radi al .. zanima me tvoje pitanje gore Smile

_________________
mount -t swap /dev/brain /mnt/head
look'n for a job
Back to top
View user's profile Send private message Visit poster's website
budha



Joined: 02 Mar 2004
Posts: 1377
Location: Osijek

PostPosted: 19.03.2005 22:53    Post subject: Add user to your forum ignore list Reply with quote

liban0n wrote:
zanima me tvoje pitanje gore Smile

sta znaci === ?

_________________
I hate to advocate drugs, alcohol, violence, or insanity to anyone, but they've always worked for me.
Back to top
View user's profile Send private message Visit poster's website
liban0n



Joined: 10 Feb 2004
Posts: 128
Location: Dubrovnik, Zagreb

PostPosted: 20.03.2005 14:43    Post subject: Add user to your forum ignore list Reply with quote

ista vrijednost i isti tip ??! Smile

da mogao sam (!mysql_num_rows($gogo) ali mi se nije dalo Smile

_________________
mount -t swap /dev/brain /mnt/head
look'n for a job
Back to top
View user's profile Send private message Visit poster's website
budha



Joined: 02 Mar 2004
Posts: 1377
Location: Osijek

PostPosted: 20.03.2005 17:33    Post subject: Add user to your forum ignore list Reply with quote

liban0n wrote:
ista vrijednost i isti tip ??! Smile

oke. to nisam znao
thx!

_________________
I hate to advocate drugs, alcohol, violence, or insanity to anyone, but they've always worked for me.
Back to top
View user's profile Send private message Visit poster's website
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 20.03.2005 17:53    Post subject: Add user to your forum ignore list Reply with quote

ponekad ti je ta vrsta usporedbe nužna kad funkcija vraća neki broj ili 'false', a ti trebaš točno znati da li je vratila 0 ili false, što ti sa == ne bi prošlo

npr. strpos()
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Gale



Joined: 04 Apr 2005
Posts: 120

PostPosted: 04.04.2005 21:14    Post subject: Add user to your forum ignore list Reply with quote

Šta nije === samo kod java skripte, prvi put ovo vidim da netko koristi u PHP-u?
Back to top
View user's profile Send private message Visit poster's website
liban0n



Joined: 10 Feb 2004
Posts: 128
Location: Dubrovnik, Zagreb

PostPosted: 05.04.2005 06:49    Post subject: Add user to your forum ignore list Reply with quote

kao sto sam napisao gore (isti tip i ista vrijednost)

_________________
mount -t swap /dev/brain /mnt/head
look'n for a job
Back to top
View user's profile Send private message Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 05.04.2005 11:28    Post subject: Add user to your forum ignore list Reply with quote

radi tog zajeba ( pisalo je == umjesto === ) je phpBB verzija 11 imala rupu..

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group