php - How to make an input identifies an table id, then get the corespondent row and change another value of that row? -
i have tables stored in database (mysql), created table show fields want this: http://prntscr.com/6mkyii
here's .php , javascript code (obviously, won't work because im not connecting local database, it's better understanding ^^): https://jsfiddle.net/4zuq8qfy/
$consulta = mysqli_query($link, "select * jogadores"); //consulta banco de dados $tabela = $consulta->fetch_all(mysqli_assoc); //ordena os dados $colunas = mysqli_num_fields($consulta); //pega o numero de colunas $rows = $consulta->num_rows; //pega o numero de linhas
my wish link these left buttons (green plus), alter values in db. set names 1, 2, 3.. 40, js because needed differentiate 1 another, , these values set thinking on id_jogador ("id_player"). i'm trying many ways interact php , javascript, or jquery, i'm not getting anywhere. last try make buttons submit input, alter table, direct php. can't differentiate buttons php, , cant compare button's name id_player want to. understand how compare these values, through id's, change field value of row.
tl/dr: want compare element name (or identifies it) id_jogador table (jogadores), then, through id, correspondent row , change field there, name_jogador or age_jogador. posted codes
ps.: heard ajax, don't know if can helps me need. ps2.: don't want @ simple code, understand !
im newbie php , more databases. apologize if code has wrong. thank ! :d
you need use sql insert put values on database, results on same page can use $_get, , count , returns values using count($colunas); determine how many tables return sql query, of updating column new value e.g. there lot of tutorials on google.
http://www.w3schools.com/sql/sql_insert.asp
http://php.net/manual/pt_br/function.count.php
;)
Comments
Post a Comment