I am after executing a mySql stored procedure in PHP. and then use a foreach loop to get the name and part1 and part2, from their columns of the table in the database. arrVal is what they are all initally stored in which I get after executing a stored procedure.
foreach ($arrVal as $key => $val) {
$P1= $val['partOne'];
$P2= $val['partTwo'];
$nme= $val['name'];
}//end foreach for task
json_encode($nme);
json_encode($P1);
json_encode($P2");
if we for example go
echo "<br/>$nme"
we a result like
wow
new
cool
for each name
in the Javascript we have
window.onload = function addCalanderEvent( title, start, end)
{
var eventName = <?php echo json_encode($nme) ?>;
var eventstart = <?php echo json_encode($P1) ?>;
var eventEnd = <?php echo json_encode($P2) ?>;
alert("the event name is " +eventName +" start " + eventstart + " end " + eventEnd);}
I then use these variable for a function but all I can get is the one furthest down in the database base (last one from the foreach) example from the result above I get "cool" and the others are missed thanks in advance all help appreciated