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 Like 14 Dislike
Previous forums Next forums
Other forums

MII Netweaver Server stopped due to CPIC connection Problem
Dear Experts,
We have SAP XMII 12.0 setup running on Netweaver 2004s,7.0, Java Stack only.

How to add functionality to a simple php calender?
Hello everyone,

I have just finished creating a simple php calander. Can someone point

Registration
ok so i have a site where people can register and login which works now thanks to someone on here th

get font info from a font file
hello,

Does anyone know how to get font info from a font file ... using php of course !
<

=> and <=
So I was digging through some code when I came across the <= operator. This is the first tim

Parse error: syntax error, unexpected $end in
hello,
i receive the error :Parse error: syntax error, unexpected $end in C:xamppxampphtdocsh

How would I do "Users not logged in since *** delete them"
I know how I would set this up, and delete the user roughly.
I'll create a table called "Use

How to make URL loads only on login
On my page, when a user login he's redirects to user_home.php. I made it also to open the chat scree

Loop column after 2 results
Hello All.

Here is what I have:

Client ID Company name Clien

Problem!
I have another problem, when i run this code i get this error "Parse error: syntax error, unexp

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