Jump to content


Photo

select count


  • Please log in to reply
4 replies to this topic

#1 StirCrazy

StirCrazy
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 20 July 2006 - 09:35 PM

maybe it's just the way I'm writing it but keep getting an error when modifying the below line:-

select count(referrer) from users where referrer='" . mysql_real_escape_string($_SESSION['user']) . "' and activated='y'");

I Need  referrer = $_SESSION['user'] and activated to = 'y' or 'v');

Can anyone help?

Many thanks,
S.C>

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 20 July 2006 - 09:40 PM

select count(referrer) AS $me from users where referrer='" . mysql_real_escape_string($_SESSION['user']) . "' and activated='y'");

$me= $_SESSION['user'] and activated to = 'y' or 'v');
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 20 July 2006 - 09:40 PM

Looks fine. Whats the problem?

#4 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 20 July 2006 - 09:46 PM

$sql = "select count(referrer) from users
where referrer='" . mysql_real_escape_string($_SESSION['user']) . "' and activated IN ('y', 'v')";

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#5 StirCrazy

StirCrazy
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 20 July 2006 - 09:51 PM

Nice one Barand: (cheers guys) YAY! Soooo glad I found this forum  ;D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users