Page 1 of 1

[SOLVED]Warning: Wrong parameter count for mysql_result()

Posted: Mon Aug 07, 2006 11:47 am
by NiGHTFiRE
Hey,
When a person logs in i'm trying to do so a column gets a date and another column gets added with one.
So i can see last itme they logged in and how many times in total they've logged in but I get this error:
Warning: Wrong parameter count for mysql_result() in /srv/www/htdocs/index.php on line 23

And this code is getting the error:

Code: Select all

$sql3 = "UPDATE members SET senastinloggad = NOW(), antal_logins = antal_logins+1 WHERE id = '{$_POST['username']}'"; 
  $result3 = mysql_result($sql3) or die(mysql_error());
Thanks,
David

Posted: Mon Aug 07, 2006 11:57 am
by feyd
You must perform the query before you ask for the results.

Posted: Mon Aug 07, 2006 11:58 am
by NiGHTFiRE
Ain't i doing that?

Posted: Mon Aug 07, 2006 11:59 am
by feyd
no.

Posted: Mon Aug 07, 2006 12:00 pm
by NiGHTFiRE
Well I how should I do then?

Posted: Mon Aug 07, 2006 12:03 pm
by feyd
mysql_query() perhaps?

Posted: Mon Aug 07, 2006 12:04 pm
by NiGHTFiRE
omg lol. How stupid can I be:P I didn't even noticed i wrote mysql_result :P
Thanks

Posted: Mon Aug 07, 2006 12:05 pm
by NiGHTFiRE
Hmm, it isn't getting updated :/

Posted: Mon Aug 07, 2006 12:07 pm
by volka

Code: Select all

echo $sql3;
Maybe it's not what you want it to be.

Posted: Mon Aug 07, 2006 12:10 pm
by NiGHTFiRE
Lol, i got it now. I forgot to change another thing as well :P
Thanks guys