Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/59.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP mysql查询代码在localhost上运行得很好,但并不';t提交到实时服务器上的数据库_Php_Mysql_Forms_Localhost - Fatal编程技术网

PHP mysql查询代码在localhost上运行得很好,但并不';t提交到实时服务器上的数据库

PHP mysql查询代码在localhost上运行得很好,但并不';t提交到实时服务器上的数据库,php,mysql,forms,localhost,Php,Mysql,Forms,Localhost,下面的代码在我的本地主机上运行良好。除了数据库的用户名和密码外,我没有更改任何代码。我是PHP的新手,但我想做的只是将用户选择的单选按钮信息存储在数据库中。这是我的php 会话_start() html表单太长,无法粘贴所有字段,因此这里仅是前两个单选按钮选项 <h4> Specifiy the informant when the Barthal Index is done in the community </h4> <input type="r

下面的代码在我的本地主机上运行良好。除了数据库的用户名和密码外,我没有更改任何代码。我是PHP的新手,但我想做的只是将用户选择的单选按钮信息存储在数据库中。这是我的php

会话_start()

html表单太长,无法粘贴所有字段,因此这里仅是前两个单选按钮选项

    <h4> Specifiy the informant when the Barthal Index is done in the community </h4>
    <input type="radio" name="informant" value="Patient">Patient<br>
    <input type="radio" name="informant" value="Main Support Person">Main Support Person<br>
    <input type="radio" name="informant" value="Both">Both<br>
    <input type="radio" name="informant" value="Other">Other<br>

    <h4><p> Mobility </p></h4>
    <input type="radio" name="mobilitylist" class="0" value="Immobile" >0 Immobile<br>
    <input type="radio" name="mobilitylist" class="1" value="Wheelchair independant (including corners/doors)" >1 Wheelchair independant (including corners/doors)<br>
    <input type="radio" name="mobilitylist" class="2" value="Help of one untrained person, including supervision" >2 Help of one untrained person, including supervision<br>
    <input type="radio" name="mobilitylist" class="3" value="Independant (may use aid)" >3 Independant (may use aid) <br>

在社区中完成Barthal索引时指定线人
患者
主要支持人员
两者都
其他
机动性

0不可移动
1个独立轮椅(包括角落/门)
2一名未经培训人员的帮助,包括监督
3独立(可使用辅助工具)

一旦表单在live server上提交,就不会发生任何事情—数据库中不会输入任何数据。但在本地主机服务器上运行良好。提前感谢,谢谢大家的帮助

您确定
$HOSTNAME
$DATABASE\u NAME
在Web服务器上选择适当的数据库是正确的吗?检查mysql\u错误结果-查看错误是什么是相同的是,它们是相同的-我有一个单独的页面,数据被发送到同一个数据库,但不同的表。我不明白它怎么能在离线状态下顺利运行,而在在线状态下什么也没发生?顺便问一下,你不应该验证用户输入吗?切勿在未检查的情况下将$\u POST数据直接插入数据库查询,或至少使用mysql\u real\u escape\u字符串($\u POST['var'])。
    <h4> Specifiy the informant when the Barthal Index is done in the community </h4>
    <input type="radio" name="informant" value="Patient">Patient<br>
    <input type="radio" name="informant" value="Main Support Person">Main Support Person<br>
    <input type="radio" name="informant" value="Both">Both<br>
    <input type="radio" name="informant" value="Other">Other<br>

    <h4><p> Mobility </p></h4>
    <input type="radio" name="mobilitylist" class="0" value="Immobile" >0 Immobile<br>
    <input type="radio" name="mobilitylist" class="1" value="Wheelchair independant (including corners/doors)" >1 Wheelchair independant (including corners/doors)<br>
    <input type="radio" name="mobilitylist" class="2" value="Help of one untrained person, including supervision" >2 Help of one untrained person, including supervision<br>
    <input type="radio" name="mobilitylist" class="3" value="Independant (may use aid)" >3 Independant (may use aid) <br>