Separating Variables Inside an Array
Posted
by
Jake Avila Talledo
on Stack Overflow
See other posts from Stack Overflow
or by Jake Avila Talledo
Published on 2013-06-26T02:38:37Z
Indexed on
2013/06/26
4:21 UTC
Read the original article
Hit count: 164
Hey i have an array an I need to separate each value so it would be something like this
$arry = array(a,b,c,d,e,f)
$point1 = (SELECT distance FROM Table WHERE Origin = a AND Destination = b);
$point2 = (SELECT distance FROM Table WHERE Origin = b AND Destination = c);
$point3 = (SELECT distance FROM Table WHERE Origin = c AND Destination = d);
$point4 = (SELECT distance FROM Table WHERE Origin = d AND Destination = e);
$point5 = (SELECT distance FROM Table WHERE Origin = e AND Destination = f);
$point6 = (SELECT distance FROM Table WHERE Origin = f AND Destination = g);
$point7 = (SELECT distance FROM Table WHERE Origin = g AND Destination = f);
$total_trav = $point1+$point2+$point3+$point4+$point5+$point6+$point7
© Stack Overflow or respective owner