Php 查询未完全显示
我想从数据库中获取的查询未完全显示。 这是关于$straat查询的问题。所有其他查询都非常好Php 查询未完全显示,php,mysql,edit,Php,Mysql,Edit,我想从数据库中获取的查询未完全显示。 这是关于$straat查询的问题。所有其他查询都非常好 <tr bgcolor='#CCCCCC'> <td>Track & Trace</td> <td>Straat & Huisnummer</td> <td>Postcode</td> <
<tr bgcolor='#CCCCCC'>
<td>Track & Trace</td>
<td>Straat & Huisnummer</td>
<td>Postcode</td>
<td>Plaats</td>
<td>Land</td>
<td>Datum</td>
<td>Klantnummer</td>
</tr>
<tr>
<td><input type="text" style="width:100%" name="track" value=<?php echo $track;?>></td>
<td><input type="text" style="width:100%" name="straat" value=<?php echo $straat;?>></td>
<td><input type="text" style="width:100%" name="postcode" value=<?php echo $postcode;?>></td>
<td><input type="text" style="width:100%" name="plaats" value=<?php echo $plaats;?>></td>
<td><input type="text" style="width:100%" name="land" value=<?php echo $land;?>></td>
<td><input type="text" style="width:100%" name="datum" value=<?php echo $datum;?>></td>
<td><input type="text" style="width:100%" name="klantnummer" value=<?php echo $klantnummer;?>></td>
<td><input type="hidden" name="id" value=<?php echo $_GET['id'];?>></td>
</tr>
</table>
<input type="submit" name="update" value="Update">
</form>
描述的问题:
<tr bgcolor='#CCCCCC'>
<td>Track & Trace</td>
<td>Straat & Huisnummer</td>
<td>Postcode</td>
<td>Plaats</td>
<td>Land</td>
<td>Datum</td>
<td>Klantnummer</td>
</tr>
<tr>
<td><input type="text" style="width:100%" name="track" value=<?php echo $track;?>></td>
<td><input type="text" style="width:100%" name="straat" value=<?php echo $straat;?>></td>
<td><input type="text" style="width:100%" name="postcode" value=<?php echo $postcode;?>></td>
<td><input type="text" style="width:100%" name="plaats" value=<?php echo $plaats;?>></td>
<td><input type="text" style="width:100%" name="land" value=<?php echo $land;?>></td>
<td><input type="text" style="width:100%" name="datum" value=<?php echo $datum;?>></td>
<td><input type="text" style="width:100%" name="klantnummer" value=<?php echo $klantnummer;?>></td>
<td><input type="hidden" name="id" value=<?php echo $_GET['id'];?>></td>
</tr>
</table>
<input type="submit" name="update" value="Update">
</form>
这是主页上的正常结果
//selecting data associated with this particular id
$result = mysql_query("SELECT * FROM tt WHERE id=$id");
while($res = mysql_fetch_array($result))
{
$track = $res['track'];
$straat = $res['straat'];
$postcode = $res['postcode'];
$plaats = $res['plaats'];
$land = $res['land'];
$datum = $res['datum'];
$klantnummer = $res['klantnummer'];
}
?>
<tr bgcolor='#CCCCCC'>
<td>Track & Trace</td>
<td>Straat & Huisnummer</td>
<td>Postcode</td>
<td>Plaats</td>
<td>Land</td>
<td>Datum</td>
<td>Klantnummer</td>
</tr>
<tr>
<td><input type="text" style="width:100%" name="track" value=<?php echo $track;?>></td>
<td><input type="text" style="width:100%" name="straat" value=<?php echo $straat;?>></td>
<td><input type="text" style="width:100%" name="postcode" value=<?php echo $postcode;?>></td>
<td><input type="text" style="width:100%" name="plaats" value=<?php echo $plaats;?>></td>
<td><input type="text" style="width:100%" name="land" value=<?php echo $land;?>></td>
<td><input type="text" style="width:100%" name="datum" value=<?php echo $datum;?>></td>
<td><input type="text" style="width:100%" name="klantnummer" value=<?php echo $klantnummer;?>></td>
<td><input type="hidden" name="id" value=<?php echo $_GET['id'];?>></td>
</tr>
</table>
<input type="submit" name="update" value="Update">
</form>
在斯特拉特和惠斯努默展出的“Roelofs Mulderweg 3”
<tr bgcolor='#CCCCCC'>
<td>Track & Trace</td>
<td>Straat & Huisnummer</td>
<td>Postcode</td>
<td>Plaats</td>
<td>Land</td>
<td>Datum</td>
<td>Klantnummer</td>
</tr>
<tr>
<td><input type="text" style="width:100%" name="track" value=<?php echo $track;?>></td>
<td><input type="text" style="width:100%" name="straat" value=<?php echo $straat;?>></td>
<td><input type="text" style="width:100%" name="postcode" value=<?php echo $postcode;?>></td>
<td><input type="text" style="width:100%" name="plaats" value=<?php echo $plaats;?>></td>
<td><input type="text" style="width:100%" name="land" value=<?php echo $land;?>></td>
<td><input type="text" style="width:100%" name="datum" value=<?php echo $datum;?>></td>
<td><input type="text" style="width:100%" name="klantnummer" value=<?php echo $klantnummer;?>></td>
<td><input type="hidden" name="id" value=<?php echo $_GET['id'];?>></td>
</tr>
</table>
<input type="submit" name="update" value="Update">
</form>
<tr bgcolor='#CCCCCC'>
<td>Track & Trace</td>
<td>Straat & Huisnummer</td>
<td>Postcode</td>
<td>Plaats</td>
<td>Land</td>
<td>Datum</td>
<td>Klantnummer</td>
</tr>
<tr>
<td><input type="text" style="width:100%" name="track" value=<?php echo $track;?>></td>
<td><input type="text" style="width:100%" name="straat" value=<?php echo $straat;?>></td>
<td><input type="text" style="width:100%" name="postcode" value=<?php echo $postcode;?>></td>
<td><input type="text" style="width:100%" name="plaats" value=<?php echo $plaats;?>></td>
<td><input type="text" style="width:100%" name="land" value=<?php echo $land;?>></td>
<td><input type="text" style="width:100%" name="datum" value=<?php echo $datum;?>></td>
<td><input type="text" style="width:100%" name="klantnummer" value=<?php echo $klantnummer;?>></td>
<td><input type="hidden" name="id" value=<?php echo $_GET['id'];?>></td>
</tr>
</table>
<input type="submit" name="update" value="Update">
</form>
当我试图用脚本编辑它时,这就是问题所在
//selecting data associated with this particular id
$result = mysql_query("SELECT * FROM tt WHERE id=$id");
while($res = mysql_fetch_array($result))
{
$track = $res['track'];
$straat = $res['straat'];
$postcode = $res['postcode'];
$plaats = $res['plaats'];
$land = $res['land'];
$datum = $res['datum'];
$klantnummer = $res['klantnummer'];
}
?>
<tr bgcolor='#CCCCCC'>
<td>Track & Trace</td>
<td>Straat & Huisnummer</td>
<td>Postcode</td>
<td>Plaats</td>
<td>Land</td>
<td>Datum</td>
<td>Klantnummer</td>
</tr>
<tr>
<td><input type="text" style="width:100%" name="track" value=<?php echo $track;?>></td>
<td><input type="text" style="width:100%" name="straat" value=<?php echo $straat;?>></td>
<td><input type="text" style="width:100%" name="postcode" value=<?php echo $postcode;?>></td>
<td><input type="text" style="width:100%" name="plaats" value=<?php echo $plaats;?>></td>
<td><input type="text" style="width:100%" name="land" value=<?php echo $land;?>></td>
<td><input type="text" style="width:100%" name="datum" value=<?php echo $datum;?>></td>
<td><input type="text" style="width:100%" name="klantnummer" value=<?php echo $klantnummer;?>></td>
<td><input type="hidden" name="id" value=<?php echo $_GET['id'];?>></td>
</tr>
</table>
<input type="submit" name="update" value="Update">
</form>
正如您在Straat&Huisummer看到的,查询不再完全显示
<tr bgcolor='#CCCCCC'>
<td>Track & Trace</td>
<td>Straat & Huisnummer</td>
<td>Postcode</td>
<td>Plaats</td>
<td>Land</td>
<td>Datum</td>
<td>Klantnummer</td>
</tr>
<tr>
<td><input type="text" style="width:100%" name="track" value=<?php echo $track;?>></td>
<td><input type="text" style="width:100%" name="straat" value=<?php echo $straat;?>></td>
<td><input type="text" style="width:100%" name="postcode" value=<?php echo $postcode;?>></td>
<td><input type="text" style="width:100%" name="plaats" value=<?php echo $plaats;?>></td>
<td><input type="text" style="width:100%" name="land" value=<?php echo $land;?>></td>
<td><input type="text" style="width:100%" name="datum" value=<?php echo $datum;?>></td>
<td><input type="text" style="width:100%" name="klantnummer" value=<?php echo $klantnummer;?>></td>
<td><input type="hidden" name="id" value=<?php echo $_GET['id'];?>></td>
</tr>
</table>
<input type="submit" name="update" value="Update">
</form>
PHP
//selecting data associated with this particular id
$result = mysql_query("SELECT * FROM tt WHERE id=$id");
while($res = mysql_fetch_array($result))
{
$track = $res['track'];
$straat = $res['straat'];
$postcode = $res['postcode'];
$plaats = $res['plaats'];
$land = $res['land'];
$datum = $res['datum'];
$klantnummer = $res['klantnummer'];
}
?>
HTML文件
//selecting data associated with this particular id
$result = mysql_query("SELECT * FROM tt WHERE id=$id");
while($res = mysql_fetch_array($result))
{
$track = $res['track'];
$straat = $res['straat'];
$postcode = $res['postcode'];
$plaats = $res['plaats'];
$land = $res['land'];
$datum = $res['datum'];
$klantnummer = $res['klantnummer'];
}
?>
<tr bgcolor='#CCCCCC'>
<td>Track & Trace</td>
<td>Straat & Huisnummer</td>
<td>Postcode</td>
<td>Plaats</td>
<td>Land</td>
<td>Datum</td>
<td>Klantnummer</td>
</tr>
<tr>
<td><input type="text" style="width:100%" name="track" value=<?php echo $track;?>></td>
<td><input type="text" style="width:100%" name="straat" value=<?php echo $straat;?>></td>
<td><input type="text" style="width:100%" name="postcode" value=<?php echo $postcode;?>></td>
<td><input type="text" style="width:100%" name="plaats" value=<?php echo $plaats;?>></td>
<td><input type="text" style="width:100%" name="land" value=<?php echo $land;?>></td>
<td><input type="text" style="width:100%" name="datum" value=<?php echo $datum;?>></td>
<td><input type="text" style="width:100%" name="klantnummer" value=<?php echo $klantnummer;?>></td>
<td><input type="hidden" name="id" value=<?php echo $_GET['id'];?>></td>
</tr>
</table>
<input type="submit" name="update" value="Update">
</form>
跟踪与跟踪
斯特拉特和惠斯努默酒店
邮政编码
普拉茨
土地
资料
三K党
>
>
>
>
试试这个:
<tr bgcolor='#CCCCCC'>
<td>Track & Trace</td>
<td>Straat & Huisnummer</td>
<td>Postcode</td>
<td>Plaats</td>
<td>Land</td>
<td>Datum</td>
<td>Klantnummer</td>
</tr>
<tr>
<td><input type="text" style="width:100%" name="track" value=<?php echo $track;?>></td>
<td><input type="text" style="width:100%" name="straat" value=<?php echo $straat;?>></td>
<td><input type="text" style="width:100%" name="postcode" value=<?php echo $postcode;?>></td>
<td><input type="text" style="width:100%" name="plaats" value=<?php echo $plaats;?>></td>
<td><input type="text" style="width:100%" name="land" value=<?php echo $land;?>></td>
<td><input type="text" style="width:100%" name="datum" value=<?php echo $datum;?>></td>
<td><input type="text" style="width:100%" name="klantnummer" value=<?php echo $klantnummer;?>></td>
<td><input type="hidden" name="id" value=<?php echo $_GET['id'];?>></td>
</tr>
</table>
<input type="submit" name="update" value="Update">
</form>
<tr bgcolor='#CCCCCC'>
<td>Track & Trace</td>
<td>Straat & Huisnummer</td>
<td>Postcode</td>
<td>Plaats</td>
<td>Land</td>
<td>Datum</td>
<td>Klantnummer</td>
</tr>
<tr>
<td><input type="text" style="width:100%" name="track" value="<?php echo html_special_chars($track);?>"></td>
<td><input type="text" style="width:100%" name="straat" value="<?php echo html_special_chars($straat);?>"></td>
<td><input type="text" style="width:100%" name="postcode" value="<?php echo html_special_chars($postcode);?>"></td>
<td><input type="text" style="width:100%" name="plaats" value="<?php echo html_special_chars($plaats);?>"></td>
<td><input type="text" style="width:100%" name="land" value="<?php echo html_special_chars($land);?>"></td>
<td><input type="text" style="width:100%" name="datum" value="<?php echo html_special_chars($datum);?>"></td>
<td><input type="text" style="width:100%" name="klantnummer" value="<?php echo html_special_chars($klantnummer);?>"></td>
</tr>
</table>
<input type="hidden" name="id" value="<?php echo html_special_chars($_GET['id']);?>">
<input type="submit" name="update" value="Update">
跟踪与跟踪
斯特拉特和惠斯努默酒店
邮政编码
普拉茨
土地
资料
三K党
正如评论中所建议的那样:
<tr bgcolor='#CCCCCC'>
<td>Track & Trace</td>
<td>Straat & Huisnummer</td>
<td>Postcode</td>
<td>Plaats</td>
<td>Land</td>
<td>Datum</td>
<td>Klantnummer</td>
</tr>
<tr>
<td><input type="text" style="width:100%" name="track" value=<?php echo $track;?>></td>
<td><input type="text" style="width:100%" name="straat" value=<?php echo $straat;?>></td>
<td><input type="text" style="width:100%" name="postcode" value=<?php echo $postcode;?>></td>
<td><input type="text" style="width:100%" name="plaats" value=<?php echo $plaats;?>></td>
<td><input type="text" style="width:100%" name="land" value=<?php echo $land;?>></td>
<td><input type="text" style="width:100%" name="datum" value=<?php echo $datum;?>></td>
<td><input type="text" style="width:100%" name="klantnummer" value=<?php echo $klantnummer;?>></td>
<td><input type="hidden" name="id" value=<?php echo $_GET['id'];?>></td>
</tr>
</table>
<input type="submit" name="update" value="Update">
</form>
value=<?php echo $straat;?>>
value=>
由于值中的空白而中断。将此行替换为
<tr bgcolor='#CCCCCC'>
<td>Track & Trace</td>
<td>Straat & Huisnummer</td>
<td>Postcode</td>
<td>Plaats</td>
<td>Land</td>
<td>Datum</td>
<td>Klantnummer</td>
</tr>
<tr>
<td><input type="text" style="width:100%" name="track" value=<?php echo $track;?>></td>
<td><input type="text" style="width:100%" name="straat" value=<?php echo $straat;?>></td>
<td><input type="text" style="width:100%" name="postcode" value=<?php echo $postcode;?>></td>
<td><input type="text" style="width:100%" name="plaats" value=<?php echo $plaats;?>></td>
<td><input type="text" style="width:100%" name="land" value=<?php echo $land;?>></td>
<td><input type="text" style="width:100%" name="datum" value=<?php echo $datum;?>></td>
<td><input type="text" style="width:100%" name="klantnummer" value=<?php echo $klantnummer;?>></td>
<td><input type="hidden" name="id" value=<?php echo $_GET['id'];?>></td>
</tr>
</table>
<input type="submit" name="update" value="Update">
</form>
value="<?php echo $straat;?>">
value=”“>
(注意连字符)解决了这个问题。您的HTML
中的表单标记在哪里?尝试检查生成的HTML查看HTML源代码。似乎街道上的空白是造成麻烦的原因(如果是真的,在源代码中应该有完整的记录)。如果是这样,请将value=
替换为“value=”“`(注意连字符),再次感谢Burki@burki我们可以聊天吗?虽然你的捕获是正确的,但它不能解决问题。还有一个提示:表末尾的隐藏字段可能会适得其反。应用程序很可能返回多个结果集,所有这些结果集都可能需要隐藏字段。将该id添加到一个“普通”的
中似乎是一个更好的解决方案,imho。该id不是数组。所以会有最后一个值。此外,它还有一定的值$\u GET['id'],这是真的。。。我个人还是更喜欢我的方法(很有趣,不是吗?:-),但是的,你的方法绝对有效。
<tr bgcolor='#CCCCCC'>
<td>Track & Trace</td>
<td>Straat & Huisnummer</td>
<td>Postcode</td>
<td>Plaats</td>
<td>Land</td>
<td>Datum</td>
<td>Klantnummer</td>
</tr>
<tr>
<td><input type="text" style="width:100%" name="track" value=<?php echo $track;?>></td>
<td><input type="text" style="width:100%" name="straat" value=<?php echo $straat;?>></td>
<td><input type="text" style="width:100%" name="postcode" value=<?php echo $postcode;?>></td>
<td><input type="text" style="width:100%" name="plaats" value=<?php echo $plaats;?>></td>
<td><input type="text" style="width:100%" name="land" value=<?php echo $land;?>></td>
<td><input type="text" style="width:100%" name="datum" value=<?php echo $datum;?>></td>
<td><input type="text" style="width:100%" name="klantnummer" value=<?php echo $klantnummer;?>></td>
<td><input type="hidden" name="id" value=<?php echo $_GET['id'];?>></td>
</tr>
</table>
<input type="submit" name="update" value="Update">
</form>