mysqli_real_escape_string() expects parameter 1 to be mysqli, null

$idbilik = " ' ". mysqli_real_escape_string($idbilik, $samb) . " ' ";
$result = mysqli_query($samb,"SELECT * FROM bilik
WHERE idbilik=$idbilik");
while($res = mysqli_fetch_array($result))

i did as u say so madam...add the line u gave before $result..but i am getting the error stated above...

What happens if you use the mysql_error() function to fetch the text message from the last MySQL operation?

Right before your while statement, do echo $mysql_error($samb);. What's the error?

Be a part of the DaniWeb community

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