bgins
0
Q:

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;
}
0

New to Communities?

Join the community