Jump to content

Check if query returns any results in PHP using ODBC Connection


nostrodamned

Recommended Posts

Hi All,

I am looking for a way to check whether a ODBC based query returns any result in PHP.

Basically something like this (though my coding is dismal and i get errors!!)

 

$sql="select * FROM marque where Nom = ".$Naam;
echo $sql;
$result=odbc_exec($conn,$sql);  //returns data
$row=odbc_fetch_array($result);

    $Nom = $row['Nom'];
    if ($Nom==""){
        echo "None Found Do Insert"     ;
    } else {
        echo "Found Result - ".$checker;
    }

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.