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
PHP5/Zend 2.0 - Resources
PHP5 Snapshots
http://snaps.php.net/
ZEND 2.0 Feature Overview and Design (PDF File
Oracle Text CTX_DOC.snippet slow
I have a table (FILE_TABLE) that contains a blob column (ft_file) and I have created the following O
Help With editting and deleting form
So look at this image :
http://img194.imageshack.us/img194/8272/snapshot5f.png
This table
IIS7 and getimagesize() problem
I have just discovered after hrs of trying to fix a problem where it's coming from. It's to do with
PHP referral database. I would like this form to email the referrer.
Okay, Hello I've been trolling for years. This the first time I've ever asked for php help. Normally
How to calculate days from variable date?
This will be easy for one of you gurus. I want to fetch the date from a variable date, for example:<
losing session vars when arriving from an email link
Hi,
I've got a confirmation script made that sends an email with a link for a user to confirm
Extra fields in main body and php required.
I'm new to PHP so please be gentle. I have a little php script below that works well.
The &quo
Save cookie to DB
I'm working on a pixel tracking script for an incentive website and I need to use an ASP script to s
read integers that returns a negative or prints the average
Im trying to finish this homework assignment by tommarow afternoon and I keep getting stuck.
Wr