Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

mysqli prepared statement select null query problem

$
0
0

Hello,

 

I have no idea what I am doing wrong.

 

I am trying to return the matching $prefixphone value only if there is a "null" value found in the column. I have been stuck on this for 2 hours, I cannot find a solution.

 

please help,

 

Thank you,

 

Ben


<?php

 

                        $stmt = $mysqli->prepare("SELECT * FROM $tbl_name WHERE phone_number=? AND  WHERE group_leader=?");
 
 
                        /* Bind our params */
                        $prefixphone = '987979879';
                        $group_leader ='IS NULL';
                        $stmt->bind_param('ss', $prefixphone, $group_leader);
 
 
                        /* Execute it */
 
                        $result = $stmt->execute();
 
                        $stmt->store_result();
 
 
                        if ($stmt->num_rows == 1)
                        {
 
 
                            echo '<div align="center" class="text-not-correct">You are a VIP member!</div>';
 
 
                            /* Close statement */
 
                            $stmt->close();
 
 
                            /* Close connection */
 
                            $mysqli->close();
 
?>

Viewing all articles
Browse latest Browse all 13200

Trending Articles