Jump to content


Photo

Mysql 4 Select into


  • Please log in to reply
1 reply to this topic

#1 wickedinfinity

wickedinfinity
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 12 November 2005 - 06:08 AM

can COUNT (*) be used in a select into statment

any help apprectated :-)

#2 Cook

Cook
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts
  • LocationSingapore

Posted 12 November 2005 - 08:44 AM

Well yes, but knowing a bit more about what exactly it is that you're trying to do would help to help you better. Anyway, try something like this:

$query = "SELECT COUNT(*) AS `mycount` FROM `mytable` WHERE (some condition of yours)";
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
echo $row['mycount'];

Cook




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users