6
I am trying to start a connection to the Mysql database and it works, but when I ask PHP to display what is there nothing appears. It’s like the connection to the BD had failed.
<?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");
while($exibe = mysql_fetch_assoc($conexao));
?><?php echo $exibe["name"]; ?>
<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>
Keep in mind that the connection information is correct if there wasn’t going to be an error, right? Why can’t I see the value inside the respective fields?
Yes friend, good morning! It was your code the solution of the problem. In the most I thank you immensely for your help. : ) It would have to return only one same line. There is no more than that. Anyway, I wanted to know if, using the UPDATE feature I can do the appropriate validations in this form. It is possible?
– Robson
Answering your last comment in the removed answer: If it’s the same problem, you’d better edit your question to add more information. If it is another problem (even if it is in the same code), it is better to post another question, otherwise mischaracterize this. Here it is not a forum, it is a website of questions and answers. That’s why it’s important to keep organized. That is, if you managed to evolve a little and now need to solve another detail of this code, is another question.
– Maniero
Okay. So, thank you.
– Robson