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

session variable problem
Session variable is not working in Fire fox i am getting null value but it is working fine in IE.

insert/update functions for mysql, what do you think?
I am working on two really simple functions that automatically generate (and execute) insert and upd

Add 5 to a variable when a button is clicked, and re-run a for loop
So I'm making a feedback sort of section on a website with MySQL and PHP, I've gotten the script to

DB2 for z/OS, LUW, iSeries
Hello, In this forum a lot of threads related to other members of the DB2 family than DB2 for z/OS

How do I replace any number of character occurences with one occurrence?
How do I replace any number of character occurences with one occurrence?

Let's say I have:

header redirect problems? please help
Ok i am making a site that generates youtube thumbnails and i am generating an image that displays 1

Clean URLs
Hi I was wandering if anyone has ever implemented URLs on their PHP run website using URLS like wiki

in php, link returns to the line
When I add a link in a php page, the link word returns to the line (as a
would do)

Examp

Php WordPress help
I am writing the following code for making a plugin

<?php
header("Content-Type

Image upload - determine folder
I have an upload script that may be accessed from different directories. Problem is, the script is m

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