PDA

View Full Version : what's wrong with this code??


squawell
11-20-2001, 03:43 AM
hey could somebody tell me what's wrong with this code


$hackviews = $DB_site->query_first("SELECT SUM(views) AS threadviews FROM thread WHERE forumid=19');
$totalhackviews=number_format($hackviews[threadviews]);


i want it like totalhackviews,but i can't write code so it not work

so what can i do make it work??

FWC
11-20-2001, 04:01 AM
It looks like you're missing a ' in front of 19 and a " after 19'. I'm not sure if that will fix it or not, but it should.

squawell
11-20-2001, 04:06 AM
Originally posted by FWC
It looks like you're missing a ' in front of 19 and a " after 19'. I'm not sure if that will fix it or not, but it should.
yes~~ur right!!

thankz man~~u give me a big help~~~

FWC
11-20-2001, 04:34 AM
Glad to help. :)

squawell
11-20-2001, 06:34 AM
now i have new problem

see this code

$today = mktime(0,0,0,date("m"), date("d"), date("y"));
$getmembertoday=$DB_site->query_first("SELECT count(*) AS userid FROM user WHERE userid='$today'");
$todaymembers=number_format($getmembertoday[userid]);


i want to count today registed member

so i do that code but no any error message~~

and it's not work too~~

which part is wrong??hope somebody help me~plz!!

Admin
11-20-2001, 11:16 AM
$getmembertoday=$DB_site->query_first("SELECT count(*) AS userid FROM user WHERE joindate='$today'");
IIRC

squawell
11-20-2001, 03:01 PM
thankz FireFly~~~

u also give me a big help too~~~:D

FireFly i find ur code have a little error

$getmembertoday=$DB_site->query_first("SELECT count(*) AS userid FROM user WHERE joindate='$today'");

should be

$getmembertoday=$DB_site->query_first("SELECT count(*) AS userid FROM user WHERE joindate>='$today'");


and it will be work~~