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
New Login Script
Hi all, i attempted to create a whole new login script witch isnt working for some reason i dont kno
mysql_affected_rows() usage
Possibly a MySQL issue, but the function that is not behaving in the anticipated way is a PHP functi
Sending a hyperlink through mail
HI all,
I am sending a mail to outlook mailbox of a user using FM SO_NEW_DOCUMENT_ATT_S
Preg_match with an array
is there an away to use preg_match with an array?
i want to check a string with an array to s
Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a ne
Having problemswith multithreading and prime numbers
I have an assignment when I'm suppose to do the following:
Write a multithreaded Java, Pt
Ball movement
I want to move a ball from one point to another and it should hit a group of balls at the other end
Help with form post data and arrays
Hi all,
I am new to this forum... It has been awhile since i have worked with arrays, and i a
check if string contain only a-z/A-Z
Is where any way to check if string contains only a-z/A-Z, without writing an array with all possibl
Question handling xml data
Hello,
I have sucessfull followed this tutorial
http://www.phpfreaks.com/tutorial/handlin