Adge
0
Q:

wpdb get results foreach

$results=$wpdb->get_results("SELECT * FROM your_table_name WHERE id LIKE' . $id . ';");
foreach($results  as $key => $row) {
// each column in your row will be accessible like this
$my_column = $row->column_name;}
0

	$records=$wpdb->query("SELECT * FROM $wpdb->posts WHERE post_type = 'elements' AND post_status = 'publish'");

	while($data=$records->fetch_assoc())
	{
		print_r($data);
	}
	
}
1

New to Communities?

Join the community