In summary through PHP below I can send the specific information already registered in the column in the BD, but in addition to just "emitting" the data there, I would like a function that would change such information without changing the page . I have an idea how to do this using the following code:
if ($action == 'okay') {
$conexao = mysql_query("update settingsMDP set name='$name', version='$version', startacp='$startacp' WHERE id='1'") or die ("Eita.. Deu errado!");
}
If they are to be seen, if the form action
is "okay" then it executes the UPDATE, but ... That does not happen I do not know why.
This is PHP.
<?php
// definições de host, database, usuário e senha
$server = "";
$usuario = "";
$banco = "";
$senha = "";
// conecta ao banco de dados
$conexao = mysql_connect($server, $usuario, $senha);
$conexao = mysql_select_db("$banco",$conexao);
if(!$conexao) {
echo mysql_error();
exit;
}
$conexao = mysql_query("select * from settingsMDP");
//********************************************mudei aqui*****************************
$exibe = mysql_fetch_assoc($conexao);
if (empty($_REQUEST['action'])) $action = ''; else $action = $_REQUEST['action'];
if ($action == 'okay') {
$conexao = mysql_query("update settingsMDP set name='$name', version='$version', startacp='$startacp' WHERE id='1'") or die(mysql_error());
}
?>
<form method="post" action="<?php $_PHP_SELF ?>">
<table width="400" border="0" cellspacing="1" cellpadding="2">
<tr>
<td width="100">Nome do MDP: </td>
<td><input name="name" type="text" id="name" value="<?php echo $exibe["name"]; ?>"></td>
</tr>
<tr>
<td width="100">Versão: </td>
<td><input name="name" type="text" id="name" value="<?php echo $exibe["version"]; ?>"></td>
</tr>
<tr>
<td width="100">Abertura do painel:</td>
<td><input name="start_acp" type="text" id="startacp" value="<?php echo $exibe["startacp"]; ?>"></td>
</tr>
<tr>
<td width="100"> </td>
<td> </td>
</tr>
<tr>
<td width="100"> </td>
<td><input name="update" type="submit" id="update" value="Salvar"></td>
</tr>
</table>
</form>