[ACCEPTED]-warning problem: expects parameter 1 to be mysqli_result-mysqli

Accepted answer
Score: 13

mysqli_query() returns FALSE if there was an error in the query. So 2 you should test for it...

/* Select queries return a resultset */
if ($result = mysqli_query($dbc, "SELECT Name FROM City LIMIT 10")) {
    printf("Select returned %d rows.\n", $result->num_rows);

    /* free result set */

See this link for 1 the mysqli_query reference http://php.net/manual/en/mysqli.query.php

Score: 1

Waterfall is probably right. Revise your 2 code as follows:

$result = mysqli_query($dbc,$sql1) or die(mysqli_error($dbc));
// and
$result = mysqli_query($dbc,$sql2) or die(mysqli_error($dbc));

PS: Just wondering what 1 exactly is $page? Did you forget to do a:

global $page;

More Related questions