Hi im ageeting the following error in my script can anyone find a fix or solution hus jan x

Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /home/letsswin/public_html/template_pageTop.php on line 7

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in /home/letsswin/public_html/template_pageTop.php on line 8

//check for new pm's
$pm_n = '<img src="images/pmStill.gif" width="17" height="12" alt="Pm" title="This pm is for logged in members">';
$sql = "SELECT id FROM pm WHERE (receiver='$log_username' AND parent='x' AND rdelete='0' AND rread='0') OR (sender='$log_username' AND sdelete='0' AND parent='x' AND hasreplied='1' AND sread='0') LIMIT 1";
    $query = mysqli_query($db_conx, $sql);
    $numrows = mysqli_num_rows($query);
    if ($numrows > 0) {
        $pm_n = '<a href="pm_inbox.php?u='.$log_username.'" title="Private Message Notifier"><img src="images/pmflash.gif" width="17" height="12" alt="Pm"></a>';
    } else {
        $pm_n = '<a href="pm_inbox.php?u='.$log_username.'" title="Private Message Notifier"><img src="images/pmstill.gif" width="17" height="12" alt="Pm"></a>';
    }

Solved it

can you assist me with the solution?
im following the same tutorial and i cannot seem to get this functioning.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.