php - if condition in html editable table
i want to display only distinct non-numeric values in html table. The table must be editable and the user could edit the table and edited data must be stored in the databas. This is what im trying without if condition it displays only distinct values of first column and repeat other column values. Answers will be appreciated.
$sql= "select distinct
,CASE WHEN col1 not regexp '[0-9]' THEN col1 else null end as col1
,CASE WHEN col2 not regexp '[0-9]' THEN col2 else null end as col2
,CASE WHEN col3 not regexp '[0-9]' THEN col3 else null end as col3
from table_name";
$run_sql= mysqli_query($conn, $sql);
while ($rows= mysqli_fetch_array($run_sql)) {
echo "
<tr>
<td>".if ($rows['two']!= NULL){
$rows['two']
}."</td>
<td>".if ($rows['three']!= NULL){
$rows['three']
}."</td>
<td>".if ($rows['four']!= NULL){
$rows['four']
}."</td>
</tr>";
}