php - IS NOT NULL giving null values -


i have following php code using pdo. want rows empty values not appear in results. how achieve this, , doing wrong below?

<?php require_once 'dbconfig.php';  try {     $conn = new pdo("mysql:host=$host;dbname=$dbname", $username, $password);     echo "connected $dbname @ $host successfully.";     $sql = 'select *              as_questions              answer not null';      $q = $conn->query($sql);     $q->setfetchmode(pdo::fetch_assoc);  } catch (pdoexception $pe) {     die("could not connect database $dbname :" . $pe->getmessage()); } 

as above suggested 2 persons (fred -ii , alex anderi) please change query below:-

$sql = "select * as_questions answer !=''"; 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -