php - if condition in html editable table

445

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>"; 
                }

People are also looking for solutions to the problem: amazon web services - Impose time limit to popen/fgets in PHP

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.