0

I am currently trying to perform a search in sqlite 3 of an existing column, and if I can not find it, I can get the names of the columns but I can not find a way to compare them with any of my variables

THIS IS MY EXAMPLE

$bd = new SQLite3('my_datebase.db');
$CONTADOR = (" PRAGMA table_info(tblLecturacion); ");
$ResultCont = $bd->query($CONTADOR);
$conteoprevio = $ResultCont->fetchArray(SQLITE3_ASSOC);
do {
    echo $conteoprevio['name'] . '<br />';}while ($conteoprevio = 
$ResultCont->fetchArray(SQLITE3_ASSOC));

i tried to look the variable using array_search, and other ways but i coundnt resolve it :(

also i tried other ways

/////// columnaA dont exist in table.

$bd = new SQLite3('my_datebase.db');
$DatosConsulta = ("SELECT columnaA FROM tblafiliacion WHERE 1=0 "); 
$Result = $bd->query($DatosConsulta);
$row_DatosConsulta = $Result->fetchArray(SQLITE3_ASSOC);

so this give an sql error, beacuse the column dont exist, i search a lot on internet, but without an answer :(

0 Answers0