Show data from Sqlite table

Asked

Viewed 193 times

1

When deleting a row from the database, when I refresh again, it does not show in a table that prints the rest of the rows, if it is deleted in the middle of the data.

The problem is I have one for which runs all rows of the table through your id, and case for example the id=3 is deleted, and has more records, such as id=4,5,etc will only show me until the id=2 because I have a select made by id. How can I fix this?

for($i=1;$i<=10;$i++){

        $requete    =   "SELECT * FROM contact WHERE (id=$i)";  
        $resultat   =   $base_hndl->query($requete);    // 
        $affiche    =   $resultat->fetchArray();
        echo "<tr align=center>";

            echo "<td>$affiche[id]</td>";
            echo "<td>$affiche[nom]</td>";
            echo "<td>$affiche[prenom]</td>";
            echo "<td>$affiche[fonction]</td>";
            echo "<td>$affiche[societe]</td>";
            echo "<td>$affiche[mobile]</td>";
            echo "</tr>";   

    }//fin de for
  • 2

    Why instead of a for you do not make a single query and use the function sqlite_fetch_array in a while to go through the result, instead of doing it this complicated way?

  • Give me error "Call to Undefined Function sqlite_open()"

  • The database is called $base = $login." _vcf.sqlite"; and use $dbhandle = sqlite_open('$base'); to open.

  • In another file, try to run the function phpinfo(); and see if the extent of sqlite is active in the version of your PHP, because if you can’t find the function sqlite_open() most likely the extension is not active.

  • The extension is not active.

  • You have access to the file php.ini? In this file, look for ;extension=php_pdo.dll and ;extension=php_sqlite.dll. Remove the ;.

  • Right, inside the file I took ; da ;Extension=php_sqlite.dll and added Extension=php_pdo.dll, and reinitiated the server. Keep giving me the same mistake.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.