I want to select the from values from database

How can i select values from database

Here is my code:

$sql = 'SELECT * FROM ' . $wpdb->base_prefix . 'item WHERE uname = "'. $_POST['login_name'] . '" '; $result = $wpdb->get_results($sql) or die(mysql_error());

foreach($result as $results) {
   $results->salt;
   $results->password;
}
echo $sal->$results[0];
echo $pwd->$results[1];

Related posts

Leave a Reply

1 comment

  1. Use Sql Query in WordPress as below.

    global $wpdb;
    $results = $wpdb->get_results ( "SELECT * FROM TABLE" );
    foreach ($results as $result)
    {
      $getdata[] = $result->$VALUE;
    }
    var_dump($getdata);