0

Need help with my mysqli statement. I get no errors on the page but my if statement does not print out anything either....

//$dbConnection works.

$extensionAdd_query_domain_extension = mysqli_query($dbConnection, "
    SELECT * 
    FROM domain 
    WHERE extensions='$extensionAdd_extension' 
    LIMIT 1");
$extensionAdd_query_domain_row = mysqli_fetch_array($extensionAdd_query_domain_extension, MYSQLI_NUM);
$extensionAdd_query_domain_id = sanitizeInt($extensionAdd_query_domain_row[0],$dbConnection);
$extensionAdd_query_domain_votes = sanitizeInt($extensionAdd_query_domain_row[2],$dbConnection);

//If domain id found in Db update votes otherwise add to list
if($extensionAdd_query_domain_id!='' && $extensionAdd_query_domain_votes!='')
    {
        echo 'Found in DB. Update Votes.'.$extensionAdd_extension;
    }
else
    {
        echo 'Not Found in DB. Enter in DB'.$extensionAdd_extension;
    }
Barmar
  • 741,623
  • 53
  • 500
  • 612
aero
  • 69
  • 1
  • 6
  • 1
    Does anything output on the page? Is the page throwing a 500? – chris85 Jun 22 '16 at 20:09
  • if the echoes don't execute, then something is killing your script BEFORE reaching that point in the code. there's no way the script could output nothing otherwise, because both code paths would produce SOME output. – Marc B Jun 22 '16 at 20:15
  • Make sure you have [error reporting enabled](http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php). – Barmar Jun 22 '16 at 20:25

1 Answers1

0

Check the connection of your database and check your result with var_dump.

/* check connection */
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}

var_dump($extensionAdd_query_domain_row);
ToyRobotic
  • 557
  • 10
  • 30