MYSQL gen help
Posted on
16th Feb 2014 07:03 pm by
admin
This is my Mysql gen. can anyone tell me why this echos
MID(networkset.networkid, 3, 3) AS "MNC" SELECT FROM scan JOIN gps ON scan.gpsid = gps.gpsid JOIN gsmscanset ON scan.scanid = gsmscanset.scanidJOIN gsmcell ON gsmscanset.cellid = gsmcell.cellid WHERE scan.typeid = 4 AND gsmcell.cellid = gsmcell.servingcellid
and not
SELECT MID(networkset.networkid, 3, 3) AS "MNC" FROM scan JOIN gps ON scan.gpsid = gps.gpsid JOIN gsmscanset ON scan.scanid = gsmscanset.scanidJOIN gsmcell ON gsmscanset.cellid = gsmcell.cellid WHERE scan.typeid = 4 AND gsmcell.cellid = gsmcell.servingcellid
heres the code:
$arr = array($date,$time,$latandlong,$satdata,$MCC,$MNC,$MCCMNC,$name,$callid,$lac,$bsic,$arfcn,$relvl,$c1,$c2,$rxq,$timing,$numres,$audio,$video,$image);
function select($arr){
foreach ($arr as $key => $value) {
if (is_null($value)) {
unset($arr[$key]);
}
}
$last_item = end($arr);
$last_item = each($arr);
reset($arr);
foreach($arr as $key => $value){
if($value == $last_item['value'] && $key == $last_item['key']){
echo ',';
}
print $value;
}
}
//echo '
';
/* FROM */
$fromdefault1=" scan JOIN gps ON scan.gpsid = gps.gpsid";
$fromdefault2=" JOIN gsmscanset ON scan.scanid = gsmscanset.scanid";
$fromdefault3="JOIN gsmcell ON gsmscanset.cellid = gsmcell.cellid";
/* WHERE */
$wheredefault="scan.typeid = 4 AND
gsmcell.cellid = gsmcell.servingcellid";
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 */
$query = "
SELECT ".select($arr)."
FROM ".$fromdefault1.$namefrom.$fromdefault2.$fromdefault3.$numresform1.$numresform2.$audiofrom.$videofrom.$imagefrom."
WHERE ".$wheredefault.$datesearch.$timesearch.$latandlongsearch . "
";
echo $query;
}
Thank
No comments posted yet
Your Answer:
Login to answer
204
14
Other forums
array_combine() trouble w/csv file
I have a problem with a piece of code I wrote to import some records from a csv file into mysql. I h
Big O & time complexity ???
can you help me how to calculate the Big O & time complexity for any algorithm and c++ program pleas
Can we convert non uni code system into unicode
Hi All,
Presently i am using non-unicode system and the sap version is 4.7.
Can i c
timezone change with date()
so i put all my times for posts in my made from scratch forum(not phpbb3 or sm)
in my mysql db u
Losing 'page' data
I have this code that allows me to update my database. But after updating, I lose the $_GET['page']
I need help with formatting date from mysql! with php!
Hello guys
*Note: this is a php question not MySQL question, please do not move it to mysql s
Stumped by Third Day of Month problem
I am trying to build an algorithm that will essentially do this:
Code: [Select]$this_month = Oct
Probably Easy, Need help with Check Boxes in PHP Code
hello,
Thanks for looking this over and helping me out. My problem is I have a online store l
Character increment
Hi,
I am facing a scenario like above,but in my case i want to show up like Col A,Col B etc..
Find only certain URLs from page ... regex (semi-complete script)
Hi guys,
What I need to do is take a page & extract all the URLs from the page &a