If in the html code value = '1', then how to say pkhp, what does this mean, the hero's name is Vlad =)

Added.

For example, enter the data in the database

mysql_query ("INSERT INTO `startpoke` (name) values('$name')") or die(mysql_error()); 

But there are a lot of these Pokemon, but the html code says that value = '1' how to say pkhp that Pokemon name is Bulbasaurus?

  • And while we are in the registration, this pokemon choose! - k0mar
  • What is so called, and so, but we choose Bulbasaurus, <input name = 'startpoke' type = 'radio' value = '1' class = 'checkbox' onChange = "fcheck ('rules')"> < b> 001 Bulbasaur </ b> <img src = img / 001.jpg width = 250 height = 190 border = 1> </ p> - k0mar

2 answers 2

Things to think about 1. Why does the figure go to php, not 001 Bulbasaur if the name is more important? 2. apparently you understand that the hero can be renamed, because you use id - then it’s strange that you don’t have a field with his name in the table with the characteristics of the hero ...

hero['id'] = 1; hero['name'] = '001 Bulbasaur'; hero['class'] = 'gopneg';

etc.

    Well, look, 1 is the user id? Those. something like this will turn out:

      $ id = $ _POST ['iduser'];
     $ res = mysql_query ("SELECT * FROM users WHERE id = '$ id'");
     $ row = mysql_fetch_array ($ res);
     $ name = $ row ['username'];  // This will be the username
    
    Of course, change the values ​​to your

    • Damn, you didn’t understand me = (There is a user, when registering he chooses a hero to play with, but to determine the name of this hero, I enter the value! - k0mar
    • Well, the user chooses "001 Bulbasaur", the number 1 goes to php instead, you need to make php understand that the number 1 means "001 Bulbasaur"? - iproger