Running 3 php files together with given variables

fahman

New Member
Previously I added few codes in my previous post that may not make sense.So here are all codes in 4 php files, The last php runs the 3 php files together to produce the output.In the end, no output is produced from gatherbatches.php,although I am able to produce output from gathertest2.php. login.php:-\[code\]<?php $dsn = 'mysql:host=localhost; Port=3306'; $user = 'root'; $pswd = ''; $dbh = new PDO($dsn, $user, $pswd, array(PDO::ATTR_PERSISTENT, TRUE)); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);?>\[/code\]gathertest2.php\[code\]<?phprequire_once '../scripts/login.php';$stmt_use = $dbh->prepare("use $v");try { $stmt_use -> execute();}catch (PDOException $err){ alert($err->getMessage()); }$stmt_call = $dbh->prepare('call listmfg_codes()');try { $stmt_call->execute();}catch (PDOException $err) { alert($err->getMessage()); }$result = $stmt_call->fetchAll(PDO::FETCH_ASSOC);$output = json_encode($result); echo $output;?>\[/code\]gatherbatches.php\[code\]<?phprequire_once '../scripts/login.php';$stmt_call = $dbh->prepare("call listbatch:)w)");$stmt_call->bindValue(':w', $w, PDO::pARAM_STR, 4000);try{ $stmt_call->execute();}catch (PDOException $err){ alert($err->getMessage()); }$result = $stmt_call->fetchAll(PDO::FETCH_ASSOC); $output = json_encode($result); echo $output;?>\[/code\]Finally, I created testworkingphpfiles.php to run these 3 files together with variables.testworkingphpfiles.php\[code\]<?phprequire_once '../scripts/login.php';$v = 'testdata2060_03';include 'gathertests2.php';$w = 'BC-1DX1A-2';include 'gatherbatches.php';?>\[/code\]What could go wrong? Please advise. ThanksClement
 
Top