The Masters are helping to see what's wrong with this section.
if (!empty ($_post[' num ')) | |
!empty ($_post[' title ') | |
!empty ($_post[' price ') | |
!empty ($_post[' years ') | |
!empty ($_post[' season ') | |
!empty ($_post[' groups ')
{
$w = Array (
foreach ($_post as $k = $v):
if (!empty ($v)) {
$k = $v;
}
Endforeach;
)
}
It's just a pass.
Reply to discussion (solution)
What is this notation, the array inside of foreach? Can you do that?
It's unheard of.
I just want to do a multi-form search,
is to limit multiple conditions to the search, each with a form,
There is a single-line text box, there are drop-down menus, you can not restrict all conditions at the same time,
I don't know how to do this.
Why do you want more forms, a form, multiple search conditions do not???
is not to filter out invalid (null) incoming items?
$w = Array_diff ($_post, Array (', 0));
You can do it.
Xuzuning!
You are my great God, worship the pleasantly surprised you adore.
if (!empty ($_post[' num ')) | |
!empty ($_post[' names ') | |
!empty ($_post[' price ') | |
!empty ($_post[' years ') | |
!empty ($_post[' season ') | |
!empty ($_post[' groups ') | |
!empty ($_post[' note '))
{
$w = Array_diff ($_post, Array (', 0));}
//paging parameter, routing mate
$config [' base_url '] = ' http://localhost/ci/index.php/product/search ';
$num = $this->product_model->search_page ($w),//$w not defined here
$config [' total_rows '] = $num;
$config [' per_page '] = 80;
$config [' uri_segment '] = ' 3 ';
$this->pagination->initialize ($config);
$pageNum = $this->uri->segment (3,1);
if ($pageNum ==1) {
$offset = 0;
}else{
$offset = $config [' Per_page ']* ($pageNum-1);
}//Paging parameter end
$data [' title '] = ' commodity center ';
//$_where = Array (' type ' = ' newstore ');
$data [' data '] = $this->product_model->search_paging ($w, $config [' Per_page '], $offset);//It says $w undefined
$w = Array (), if ($_post) { $w = Array_diff ($_post, Array (', 0));} Paging parameters, routing mates .....
Master Master High Master
Thanks to xuzuning for helping us birds.