0

Hey. So basically I am working on a simple project, I am no PHP expert, I only know a bit of the basics. This project is simply a "performance monitor" script. I have the parts to add records etc. I am now starting to tackle the next phase of the project that is to modify the records to give "infractions" or "bonus". I want to keep this simple and have the following fields on the edit form:

PLAYER NAME:
Dropdown List of the PLAYER_NAME column on my table called players
I grabbed this code from a different thread (and edited it in an attempt to match my table).

echo "Select a name: <select name='$name'>";
$query="select PLAYER_NAME from PLAYERS";
$result=mysql_query($query);
while($row=mysql_fetch_array($result)){
$name=$row['PLAYER_NAME'];
echo "<option value='$name'>$name</option>";
}
echo "</select>";

I tried to understand it as I modified it, but aparently I misunderstood it becuase it's not working right, this gives me nothing but an empty dropdown box.

Here is a screenshot of my current "players" table, so you can see the structure and what not:[img]http://img823.imageshack.us/img823/1118/playerse.jpg[/img]
(also attached)

INFRACTION/BONUS
A box to add or subtract "points". I am thinking along the lines of a number text entry with a radio button for options for either BONUS(add) or INFRACTION (subtract)

NOTES
Just a simple text box for comments.

TIMESTAMP
I will do this easily with a field on the SQL table

What is wrong with the above PHP code I have for the dropdown box? Also how would I go about making this a usable form?
I simply want to create new records with all of the above data on a new table I will create called "infractions". I then want to use the data from the "INFRACTION/BONUS" Field to edit the "ND_POINTS" value on the players table.

I know the post is a little long, but I would appreciate any help and guidance you can offer in this project. Thanks.

Edited by Dega: n/a

Attachments playerse.jpg 10.07 KB
1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Dega
0

got it. the "PLAYERS" was case sensitive
Now all I need is help on how to make this part of a form, where I can submit data via the $_POST method and use the data to edit my tables etc. I can work on the next part. Just want assistance on how to make the rest of my form.
thanks again.

Edited by Dega: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.