Re: Wrong parameter count
| From: | Brian Clark | Date: | Tue, 17 Apr 2001 03:55:21 +0000 |
| Subject: | Re: Wrong parameter count | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-48884@lists.php.net to get a copy of this message | ||
Hi Peter,
@ 11:40:06 PM on 4/16/2001, Peter Houchin wrote:
> Hi, can some one please help me figure out why the value $device
> isn't being passed on out of the select box? i keep getting this
> message when i view the source
(OK, lets try this again)
> Wrong parameter count for mysql_result() in D:\erentals/1.php on line 19
> <form name="select" method="post" action="1.php">
> <select name="device"><?
> $query ="SELECT DISTINCT device FROM 3backup";
> $result = mysql_query($query);
> $device = mysql_result($rs); // line 19
Two parameters are required, the third is optional.
mixed mysql_result (int result, int row [, mixed field])
So you're just getting one row with mysql_result(). You probably want
mysql_fetch_array() or mysql_fetch_object() if you want more than one
row.
If you don't, you'll need to use mysql_result($rs,$i) where $i is a
row number.
-Brian
--
PGP is spoken here: 0xE4D0C7C8
Please, DO NOT carbon copy me on list replies.