“$ wpdb foreach” Kode Jawaban

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

$ wpdb foreach


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

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

Jawaban yang mirip dengan “$ wpdb foreach”

Pertanyaan yang mirip dengan “$ wpdb foreach”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya