![]() |
Re: PHP, MySQL, and Dropdown lists
Shouldn't you be doing something like UPDATE belt_owner SET $belt = '$new' WHERE wrestlername = 'Trent Sinn'. Or are these same people always going to have a belt? Could you maybe return the results of describe table; for the tables you're talking about? I'm not totally positive how you're doing this. I think I kinda see.. but it's a weird db design that I can't really grasp without seeing..
|
Re: PHP, MySQL, and Dropdown lists
Quote:
Table - Fields --------------- admin - username, password belt_owner -[list of belts] news - [news stuff] wrestler - [wrestler info] ------------------ The belt's values are who owns them. The reason for this is because a wrestler could hold more than 1 belt. I'm gonna keep it like this though (atleast for now). I get what you're saying though. But my field is set up to enter the belt to change, the current holder, and the new holder. So, I can't really do it the way you did by specifically (sp?) saying who holds the belt. Thanks though :) |
Re: PHP, MySQL, and Dropdown lists
Hrm. Okay.. so your belt_owner table has two columns.. one for the belt name and one for the owner of the belt? UPDATE belt_owner SET $belt = '$new' WHERE $belt = '$old' should be
Code:
UPDATE belt_owner SET wrestler_name = '$new' WHERE belt_name = '$belt'(and what I meant by describe table.. was actually running 'describe table' in mysql.. so you get stuff like this:) Code:
mysql> describe myposts; |
Re: PHP, MySQL, and Dropdown lists
Quote:
Quote:
+--------+------+---------+-------+--------+---------+----------+ |heavyweight|tv|cruiserweight|no_limits|tag_team1| tag_team2|team_name +--------+------+---------+-------+--------+---------+----------+ |Devon Matthews|Trent Sinn|Red Ninja| | | |CIA| +--------+------+---------+-------+--------+---------+----------+ The blank spots are vacant holdings. If I wanted to change Trent Sinn to say, raevin, the code wouldn't work (aka: the Cruiserweight title will still say Trent Sinn). |
Re: PHP, MySQL, and Dropdown lists
Huh.. okay.. that's an interesting way to do it. Well, then your SQL line should have been right. Try printing it out to make sure the values are what you expect them to be.
|
Re: PHP, MySQL, and Dropdown lists
Ok, 1 last question I think.
I got my other problems fixed so far, but now I'm having trouble showing the bio of the wrestler. I can get it to show everything but the weight. I've been working on this for about 1.5 days, and I can't understand why it's not working: PHP Code:
If anyone can help me w/ this, I will gladly appreciate it. |
Re: PHP, MySQL, and Dropdown lists
Just for kicks, try print_r($row); which will print the array. Make sure it's set and you have the column name correct. The code is fine, so I'd guess it's something small.
|
Re: PHP, MySQL, and Dropdown lists
Quote:
|
| All times are GMT -5. The time now is 00:29. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi