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);

Did you know?Explore Trending and Topic pages for more stories like this.
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 Like 37 Dislike
Previous forums Next forums
Other forums

Need help to modify php ELSE code
I'm trying to find a way to have the php code display a message if there is no inventory listed in t

Share admin accross websites
I'm using .net memberships and roles in one of my sites, but I need to be able to share logins and p

Interpret Order
Hello all,

I'm wondering if I have this:

Code: $switch = array(
'one' =>

does anyone know a php script to send mail using gmails/googles free smtp server
cause i heard u can do that but i dont know how

HTAccess auto log in?
Hi all.

Too busy driving celebs about lately so I hope someone here can help me out.

I

Can anyone give me some link on .htaccess tutorial
i wish to have friendly url using .htaccess, but no idea yet about this

Hope that anyone cou

HeaderSelectedCssClass not working
I have an accordian where I have a drop down list in the first pane and a grid in the second pane.

Product categories for registration
Dear all,

We are going live with the Supplier registered next week. At standard, the 'sel

mysql_real_escape_string
Let me preface this that I am very much a PHP noob, but I have some SQL training (not necessarily My

DOMDocument
Hello All,

I need to take an XML document, modify some of the nodes in it and then perform a

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash