我有一个数据库,其中1列值将始终为空。我希望它传递到下一页,但它传递的是除此空值列之外的其他列的所有值。
这是我的代码
$row=mysql_query("SELECT * FROM `thirdpartycategorymaster` WHERE ISNULL(`delete`)");
while($row1=mysql_fetch_array($row))
{
<td><b><a href="catdel.php?head1=<?php echo $row1['ThirdPartyCategoryName'] . '&&msg1=' . $row1['ThirdPartyCategoryID'] . '&&ctdel=' . $row1['delete']; ?> ">Delete</a></b></td>
This my db table ThirdPartyCategoryID ThirdPartyCategoryName 29电子商务NULL
发布于 2010-12-24 17:49:23
<?php
// ...
while($row1 = mysql_fetch_array($row)) {
?>
<td><b><a href="catdel.php?head=<?php echo $row1['ThirdPartyCategoryName'] ?>&msg1=<?php echo $row1['ThirdPartyCategoryID']?>&ctdel=<?php echo ((is_null($row1['delete'])) ? 'null' : $row1['delete']) ?>">Delete</a></b></td>
<?php
}
?>未经测试..。但我认为它会满足您的需求;-)
发布于 2010-12-24 18:08:33
好吧,MySQL中的PHP值在null中会转换为null。
如果你用null连接一个字符串,那么你会得到相同的字符串(null变成一个空字符串):
echo 'This is null: ' . null;
// prints This is null: 您到底想要作为值传递什么?字符串'null'?如果是这样,因为所有条目在字段中都有null,您可以直接对其进行硬编码:
echo $row1['ThirdPartyCategoryName'] . '&msg1=' . $row1['ThirdPartyCategoryID'] . '&ctdel=null';https://stackoverflow.com/questions/4525426
复制相似问题