如果db行为空,则提交表单

时间:2015-09-08 05:20:44

标签: php database row

如果Submit行为空,我会使用此代码显示invoice表单按钮。如果不是,那么我会显示invoice行值。主要问题是我无法弄清楚如何进行语法正确的更改以显示其他提交按钮,现在行发票值为。

". (empty($row['invoice'])? '<form action="page.php" method="post"><input type="submit" alt="Submit Form" value="Submit" /></form>' :  $row['invoice']) ." 

我认为它应该是这样的:

". (empty($row['invoice'])? '<form action="page.php" method="post"><input type="submit" alt="Submit Form" value="Submit" /></form>' :  '<form action="page.php" method="post"><input type="submit" alt="Submit Form" value="Submit" /></form>' ." 

也许有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

复制下面的代码,你错过了)

(empty($row['invoice']))? '<form action="page.php" method="post"><input type="submit" alt="Submit Form" value="Submit" /></form>' :  '<form action="page.php" method="post"><input type="submit" alt="Submit Form" value="Submit" /></form>'