Need Help in PHP MySQL?

PHP MySQLI code not working

$q = “UPDATE users SET password = ‘6c55803d6f1d7a177a0db3eb4b343b0d50f9c111’ WHERE id = ‘1’;”;
mysqli_query($dbc, $q);

Dot knows but some cause it keeps giving me the following error:

[B]
Warning: mysqli_query()

Expects parameter 1 to be mysqli, null given[/B]

Can anyone help me

Thanks in advance

Where are you defining/declaring the variable $dbc?

As shown in the PHP Manual, $dbc needs to be the result of mysqli_connect (second example)

Also, in your SQL, you do not need the second-to-last semicolon.
Change:


$q = "UPDATE users SET password = '6c55803d6f1d7a177a0db3eb4b343b0d50f9c111' WHERE id = '1';";

To:


$q = "UPDATE users SET password = '6c55803d6f1d7a177a0db3eb4b343b0d50f9c111' WHERE id = 1";

Also note that you don’t need to (and probably shouldn’t) quote integer values in your SQL.