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
Windows 7
Windows 7 default user account control worries experts. Corporate IT departments should be pleased w
Contact Form Not Working When I Add Validation Codes
So I built my first working PHP "Contact Us" like form. But, I have been trying to now mak
setcookie and isset($_COOKIE(name)) seem very finnicky.
I'm currently playing around with a user system with login and registration. I'm trying to use cooki
How do I use a global footer..?
If my index.php has a bole bunch of if functions and exit's in them
MS are the best!!!
Visit http://www.microsoft.com/australia/windows/default.aspx?h=watch-a-demo and click the massive '
PHP error. Need help urgently
Hi,
I am programming a php site and have a problem that i just cant find out how to fix. When
To add a field on the screen XK02.
Hi All,
How to add an additional field in the vendor change control screen XK02.
The
Checking if a process is running (problems including psapi.dll i think...)
Ok, so all I'm trying to do is check if a program is running...
I've found out that I nee
Warehouse Management
Hi,
On our system, we have two storage locations ( A and B ) where A is the main factory
date("now") prints out wrong date ?
Hi Guys
Anyone know why and how I can fix it ?