Answers for "wordpress select all data from table foreach"

PHP
0

php wpdb foreach

get_header();
function get_records()
{
	//$con=connectsql();
	$records=$wpdb->query("SELECT * FROM $wpdb->posts WHERE post_type = 'elements' AND post_status = 'publish'");
	$all=array();
	while($data=$records->fetch_assoc())
	{
		$all[]=$data;
	}
	return $all;
}
Posted by: Guest on July-01-2020

Code answers related to "wordpress select all data from table foreach"

Browse Popular Code Answers by Language