一个表单到mysql查询

时间:2013-03-01 20:39:42

标签: mysql

人们,我需要一个带有textarea(名字大小)的表格到mysqli_query $ ebur

索拉,我的英语不好:(

<?php
$con=mysqli_connect("ipaddress","user","passw","account");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Falha ao receber moedas, informa o administrador com o codigo 445ebmds. " . mysqli_connect_error();
  }

mysqli_query($con,"UPDATE `account` SET `coins`='2000' WHERE ($ebur)");

mysqli_close($con);
?>

1 个答案:

答案 0 :(得分:0)

这样的事情:

mi_page.php

    <?php

    if(isset($_POST['ebur']))
    {
        $ebur = mysql_real_escape_string($_POST['ebur']);
    $con=mysqli_connect("ipaddress","user","passw","account");
    // Check connection
    if (mysqli_connect_errno())
      {
      echo "Falha ao receber moedas, informa o administrador com o codigo 445ebmds. " . mysqli_connect_error();
      }

    mysqli_query($con,"UPDATE account SET coins='2000' WHERE mi_field_on_the_table_account = '$ebur'");

    mysqli_close($con);
    }
    ?>

    <form method="post" action ="mi_page.php">
    <textarea rows="4" cols="50" id="ebur" name="ebur">

    </textarea>
            <input type="submit" value="Enviar" />
    </form>

全部在同一档案中。

来自智利的Saludos;)