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];
Read the
wpdb
docs and don’t forget to protect your query: