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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
NiGHTFiRE
Forum Contributor
Posts: 156
Joined: Sun May 14, 2006 10:36 am
Location: Sweden

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

Post 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
Last edited by NiGHTFiRE on Mon Aug 07, 2006 12:14 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You must perform the query before you ask for the results.
NiGHTFiRE
Forum Contributor
Posts: 156
Joined: Sun May 14, 2006 10:36 am
Location: Sweden

Post by NiGHTFiRE »

Ain't i doing that?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

no.
NiGHTFiRE
Forum Contributor
Posts: 156
Joined: Sun May 14, 2006 10:36 am
Location: Sweden

Post by NiGHTFiRE »

Well I how should I do then?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

mysql_query() perhaps?
NiGHTFiRE
Forum Contributor
Posts: 156
Joined: Sun May 14, 2006 10:36 am
Location: Sweden

Post by NiGHTFiRE »

omg lol. How stupid can I be:P I didn't even noticed i wrote mysql_result :P
Thanks
NiGHTFiRE
Forum Contributor
Posts: 156
Joined: Sun May 14, 2006 10:36 am
Location: Sweden

Post by NiGHTFiRE »

Hmm, it isn't getting updated :/
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Code: Select all

echo $sql3;
Maybe it's not what you want it to be.
NiGHTFiRE
Forum Contributor
Posts: 156
Joined: Sun May 14, 2006 10:36 am
Location: Sweden

Post by NiGHTFiRE »

Lol, i got it now. I forgot to change another thing as well :P
Thanks guys
Post Reply