WordPress.org

Ready to get started?Download WordPress

Forums

Shortcode Exec PHP
failed to get value from database using shortcode exec PHP (1 post)

  1. nencor
    Member
    Posted 5 months ago #

    i have created the following PHP code

    <?php
    
    global $wpdb;
    
    $myrows = $myrows = $wpdb->get_results("SELECT um.meta_value FROM wp_users u, wp_usermeta um
    where u.id = um.user_id and um.meta_key='twitter' and u.user_login='soulartist'");
    
    return str_replace("@","",$myrows);
    
    ?>

    and when i hit the 'test' button, it shows messagebox with
    "[return_twitter]="""

    when i run the query on phpmyadmin, it returns a single value "@yuliusshandy"

    where did i go wrong ?

    thanks !

    https://wordpress.org/plugins/shortcode-exec-php/

Reply

You must log in to post.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 5 months ago by nencor
  • This topic is not a support question
  • WordPress version: 3.8.1

Tags

No tags yet.