• I want to show the data, that has been entered mostly to a column in wordpress. I have this columns in my custom wp database;

    field_name  field_value
    id          1
    entry       489
    Submitted   indirimdeki
    IP          212.156.66.142
    id          1
    entry       689
    Submitted   indirimdeki
    IP          212.156.66.142
    id          750
    entry       indirimdeki
    Submitted   212.156.66.142
    IP          1
    id          790
    entry       zamli
    Submitted   212.156.66.142
    IP          1

    I need the most popular Word in column “field_value” according to “field_name”. There ara numbers and words in that field and i need only the Word that has been entered mostly.

    I try to do that with this code;

    $maks = $wpdb->get_results( 'SELECT MAX( field_value )
    FROM wp_cf7dbplugin_submits
    WHERE field_name = "Submitted"', OBJECT );
    echo $maks;

    but the output is “ARRAY” only.

    How can I manage it?

    Thank you very much.

Viewing 1 replies (of 1 total)
  • The result of the query is an ARRAY. If you just want to see the data you can use the php ‘var_dump()’ function, If you want to access the individual items in the array you should do a google search ‘php array accessing items’ to see the code you will need to use.

Viewing 1 replies (of 1 total)
  • The topic ‘How to echo data from mysql query’ is closed to new replies.