Need help urgant
Posted on
16th Feb 2014 07:03 pm by
admin
why down my code ony return one item instead of all the items selected.
$arr = array($date,$time,$latandlong,$satdata,$MCC,$MNC,$MCCMNC,$name,$callid,$lac,$bsic,$arfcn,$relvl,$c1,$c2,$rxq,$timing,$numres,$audio,$video,$image);
foreach ($arr as $key => $value) {
if (is_null($value)) {
unset($arr[$key]);
}
}
function select($array){
$last_item = end($array);
$last_item = each($array);
reset($array);
foreach($array as $key => $value){
if($value == $last_item['value'] && $key == $last_item['key']){
echo ',';
}
return $value;
}
}
if (isset($datebetween, $dateand)){$datesearch=' AND DATE(gps.date) BETWEEN '.$datebetween.' AND '.$dateand.'';}
if (isset($timebetween, $timeand)){$timesearch=' AND DATE(gps.time) BETWEEN '.$timebetween.' AND '.$timeand.'';}
if (isset($timebetween, $timeand)){$timesearch=' AND DATE(gps.time) BETWEEN '.$timebetween.' AND '.$timeand.'';}
if (isset($lat, $long)){$latandlongsearch=' AND DATE(gps.time) BETWEEN '.$lat.' AND '.$long.'';}
$query = 'SELECT '.select($arr).'
FROM '.$fromdefault1.$namefrom.$fromdefault2.$fromdefault3.$numresform1.$numresform2.$audiofrom.$videofrom.$imagefrom.'
WHERE '.$wheredefault.$datesearch.$timesearch.$latandlongsearch . ' ';
/* Query */
echo $query;
}
thank you!
No comments posted yet
Your Answer:
Login to answer
109
37
Other forums
I would like "for" to wait 5 sec
I would like my 'for' loop to wait 5 sec before second iteration.
for ($i=0; $i<10
insert Multiple rows into the table from that table data
Hi All,
I have a requirement like to insert mulitple rows into the table from that
is_dir() problem
Hello,
I'm buidling a php scripts that dynamically get's subfolders from a specific folder.
need help in dynamic select menu in php
hi i have created a dynamic select menu using php. i have a problem in that which is when the user s
Uploading Filetypes and placing them in seperate folders.
Hello,
first post , and asking for help im afraid. Very new to PHP, was making good progress
Linux socket programming
Where can I find a good introduction to socket programming?
Comparing two dates
Hi Guys
I have two dates I want to compare. Below is my current implementation. The problem with
Header is not working in IE
Hi ! header function is not working in IE but it works in FF, Safari, Chrome. any help please. :
How to change www in url with a specified name
Hi
I'm trying to change the url http://www.sitename.com/apparels to something like below
http:
I need some help with the IF command...
I have a large number of images in one section of my website with the .jpg format. I'm adding a bun