PHP Lost Connection..
I'm trying to use the following PHP code to call two MySQL Stored Procedures...
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php
ini_set("display_errors", 1);
$link = mysqli_connect("localhost", "root", "trustno1");
if (mysqli_connect_errno()) {
die ("Error connecting MySQL: ".mysqli_connect_error());
}
mysqli_select_db($link,"pers");
if ($result = mysqli_query($link,"call getCountries()")) {
while ($row = mysqli_fetch_array($result)) {
echo $row[0].'<br>';
$query = "call getCapitals(\"".$row[0]."\")";
if ($result2 = mysqli_query($link,$query)) {
while ($row2 = mysqli_fetch_array($result2)) {
echo $row2[0].'<br>';
}
} else { echo mysqli_error($link); }
}
}
?>
It loops through the outer loop OK but when trying to do the inner loop I first get..
Lost connection to MySQL server during query
and then on subsequent calls get
MySQL server has gone away
Any ideas ?
Andrew Gilfrin
------------------
http://gilfster.blogspot.com
My MySQL related Blog
http://www.mysqldevelopment.com
MySQL Stored Procedure,Trigger, View.... (Just about most things these days) Information