-1

I'm working on a feedback form and db using mysql and phpmyadmin. I've got everything up and running. So users submit feedback and is instantly shown on a website. Now I want to add a functionality to the db, so as to be able to approve the feedback before it is sent to the website. I thought of adding a column (Controle) to the db and to check then if this field (Controle) contains an 'ok' but I don't get this to work. But maybe there's a better solution?

Below my code for writing from the db to the website:

$query = mysql_query("SELECT * FROM comments ORDER BY id DESC");

while (($row = mysql_fetch_array($query)) && ($Controle == $row['ok']))
{ echo " 
       ".$row['Country'].",
       ".date('l \t\h\e jS \o\f F Y', strtotime($row['Date'])).",<br/>
       ".$row['Comment']."<br/>
       ".$row['Name']."
       <br/><br><hr><br/>";}

Thanks!

4

1 回答 1

0

是什么阻止您在 SQL 中使用 WHERE?

SELECT * FROM comments WHERE Controle = 'ok' ORDER BY id DESC
于 2013-09-17T09:01:40.817 回答