Been struggling with this for two days (and the rest). Read a couple of dozen posts from this site, been reading lots from w3 schools and lots of other resources online.
All I’m trying to do is show how many people have signed a petition.
After many failures, I wiped what I had and started from scratch.
I tried a few bits of code from w3 to check my connection to my database, the PDO didn’t work at all, but object oriented worked fine. (Showed “connection successful” on my page.)
So then tried the code below, which I took from the PHP manual and still can’t get it to work.
Would really appreciate some help.

    <?php
$link = mysqli_connect("localhost", "my user", "my password", "my db");

/* check connection */
if (mysqli_connect_errno()) {
    printf("Connect failed: %sn", mysqli_connect_error());
    exit();
}

if ($result = mysqli_query($link, "SELECT Code, Name FROM 'wp_rm_submissions' ORDER BY Name")) {

    /* determine number of rows result set */
    $row_cnt = mysqli_num_rows($result);

    printf("So far %d people have signed the petition.n", $row_cnt);

    /* close result set */
    mysqli_free_result($result);
}

/* close connection */
mysqli_close($link);
?>

Extra info..
I’ve also tried it without the single quotes around the table name.
My website is here http://becomingjohnnynova.com/temp/
It’s a wp site, if that matters.

Thanks

Read more here: Can’t get simple Object oriented row count to display


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: