JeRRy wrote:
Okay here is the full code.  Now I got this code off a friend!  In this first 
section to display the data that is grabbed from the db.
  $db = mysql_connect("localhost", "user", "pass");
  $result = mysql_query("SELECT `nickname`  FROM tipping
ORDER BY `score`
DESC LIMIT 0, 30",$db);
  while ($myrow = mysql_fetch_row($result)) {
<br><input type=text name=username[$a] value=%s> <br>",
  <input type="submit" value="submit">
It displays the data fine. Please note in the above there is more code and I doubt the issue is in there as the data fetching shows fine, I believe the error lies somewhere below. Than the form submit is pushed to another page with this code: --- <?
      if ($REQUEST_METHOD == "POST") {
            $usr = "user";
            $pwd = "pass";
            $db = "db_select";
            $host = "localhost";
              $cid = mysql_connect($host,$usr,$pwd);
// NOTE that form fields automatically become variables

Re: this comment - they only do if you have register_globals turned on.

If you have it turned off (very very good idea!), you have to:

$username = $_POST['username']['$a']

Then you can use that in your query instead of $username[$a]

Note that the quotes are important - otherwise it will look for variable $a which doesn't exist (at least in this code).

I don't know why you have the input area named like this:

<input type=text name=username[$a]

but that's up to you (me, I'd just call it 'username').

Check register_globals with a phpinfo page.

Postgresql & php tutorials

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to