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
Why instead of a
foryou do not make a single query and use the functionsqlite_fetch_arrayin awhileto go through the result, instead of doing it this complicated way?– Thomas
Give me error "Call to Undefined Function sqlite_open()"
– akm
The database is called $base = $login." _vcf.sqlite"; and use $dbhandle = sqlite_open('$base'); to open.
– akm
In another file, try to run the function
phpinfo();and see if the extent ofsqliteis active in the version of your PHP, because if you can’t find the functionsqlite_open()most likely the extension is not active.– Thomas
The extension is not active.
– akm
You have access to the file
php.ini? In this file, look for;extension=php_pdo.dlland;extension=php_sqlite.dll. Remove the;.– Thomas
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.
– akm