Xman51
06-29-2005, 03:51 PM
Hello All,
I am having an issue with my php timing out, I don't understand why. I have made this type of adodb connection string before and it worked fine.
Here is my AS:
var DrawnArr:Array = new Array();
function checkValue(val:Number,arr:Array):Boolean{
for(var i=0;i<arr.length;i++){
if(arr[i]==val){
return true;
}
}
return false;
}
//=================================
// INIT
//=================================
var path = "http://localhost/kikaijin/"; //declare path to php files
var lvOut = new LoadVars(); //create lv object
var lvIn = new LoadVars(); //create lv object
lvIn.onLoad = function (success) {
if(success){
//PHP variable value to textbox
cName.text = lvIn.retCN;
cType.text = lvIn.retCT;
cSubType.text = lvIn.retST;
cMicroType.text = lvIn.retMT;
cDescription.text = lvIn.retCD;
cPower.text = lvIn.retCP;
cLevel.text = lvIn.retCL;
}else{
//...or notify of failure
cName.text = "fail";
cType.text = "fail";
cSubType.text = "fail";
cMicroType.text = "fail";
cDescription.text = "fail";
cPower.text = "fail";
cLevel.text = "fail";
}
}
//=================================
// BTN
//=================================
myBtn.onRelease = function(){
//for (var i=0; i<6; i++){
suit1 = Math.random() * 4;
suit1 = int(suit1)+1;
face1 = Math.random() * 13;
face1 = int(face1)+1;
card1 = ((suit1 - 1) * 13)+face1;
tocard1 = card1+1;
//trace(tocard1);
lvOut.ID = tocard1;
trace(lvOut.ID);
lvOut.sendAndLoad(path + "draw.php", lvIn, "POST");
DrawnArr.push(tocard1);
//}
};
Here is my php:
<?
$cardID= $_POST['ID'];
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
// Microsoft Access connection string.
$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\\phpdev\\www\\kikaijin\\Cards.mdb");
// SQL statement to build recordset.
$rs = $conn->Execute("SELECT * FROM List WHERE ID=$CardID;");
// Display all the values in the records set
while (!$rs->EOF) {
$cardN = $rs->Fields("cName");
$cardT = $rs->Fields("cType");
$cSubT = $rs->Fields("cSubType");
$cMicr = $rs->Fields("cMicroType");
$cDesc = $rs->Fields("cDescription");
$Power = $rs->Fields("cPower");
$Level = $rs->Fields("cLevel");
}
$rs->Close();
echo "&retCN=$cardN";
echo "&retCT=$cardT";
echo "&retST=$cSubT";
echo "&retMT=$cMicr";
echo "&retCD=$cDesc";
echo "&retCP=$Power";
echo "&retCL=$Level";
?>
It took a monumental amount of time to load the return values in my movie and when it did it returned the value "undefined" in every field. So I checked the php itself on my localhost and replaced the value of $cardID with the value "3" and it gave me the following output:
Fatal error: Maximum execution time of 30 seconds exceeded in c:\phpdev\www\kikaijin\draw.php on line 17
Does anyone see the error in my logic...I have gone over the code 1000 times and I don't see it. :eek: :confused:
Thanks in Advance,
Xman51
I am having an issue with my php timing out, I don't understand why. I have made this type of adodb connection string before and it worked fine.
Here is my AS:
var DrawnArr:Array = new Array();
function checkValue(val:Number,arr:Array):Boolean{
for(var i=0;i<arr.length;i++){
if(arr[i]==val){
return true;
}
}
return false;
}
//=================================
// INIT
//=================================
var path = "http://localhost/kikaijin/"; //declare path to php files
var lvOut = new LoadVars(); //create lv object
var lvIn = new LoadVars(); //create lv object
lvIn.onLoad = function (success) {
if(success){
//PHP variable value to textbox
cName.text = lvIn.retCN;
cType.text = lvIn.retCT;
cSubType.text = lvIn.retST;
cMicroType.text = lvIn.retMT;
cDescription.text = lvIn.retCD;
cPower.text = lvIn.retCP;
cLevel.text = lvIn.retCL;
}else{
//...or notify of failure
cName.text = "fail";
cType.text = "fail";
cSubType.text = "fail";
cMicroType.text = "fail";
cDescription.text = "fail";
cPower.text = "fail";
cLevel.text = "fail";
}
}
//=================================
// BTN
//=================================
myBtn.onRelease = function(){
//for (var i=0; i<6; i++){
suit1 = Math.random() * 4;
suit1 = int(suit1)+1;
face1 = Math.random() * 13;
face1 = int(face1)+1;
card1 = ((suit1 - 1) * 13)+face1;
tocard1 = card1+1;
//trace(tocard1);
lvOut.ID = tocard1;
trace(lvOut.ID);
lvOut.sendAndLoad(path + "draw.php", lvIn, "POST");
DrawnArr.push(tocard1);
//}
};
Here is my php:
<?
$cardID= $_POST['ID'];
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
// Microsoft Access connection string.
$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\\phpdev\\www\\kikaijin\\Cards.mdb");
// SQL statement to build recordset.
$rs = $conn->Execute("SELECT * FROM List WHERE ID=$CardID;");
// Display all the values in the records set
while (!$rs->EOF) {
$cardN = $rs->Fields("cName");
$cardT = $rs->Fields("cType");
$cSubT = $rs->Fields("cSubType");
$cMicr = $rs->Fields("cMicroType");
$cDesc = $rs->Fields("cDescription");
$Power = $rs->Fields("cPower");
$Level = $rs->Fields("cLevel");
}
$rs->Close();
echo "&retCN=$cardN";
echo "&retCT=$cardT";
echo "&retST=$cSubT";
echo "&retMT=$cMicr";
echo "&retCD=$cDesc";
echo "&retCP=$Power";
echo "&retCL=$Level";
?>
It took a monumental amount of time to load the return values in my movie and when it did it returned the value "undefined" in every field. So I checked the php itself on my localhost and replaced the value of $cardID with the value "3" and it gave me the following output:
Fatal error: Maximum execution time of 30 seconds exceeded in c:\phpdev\www\kikaijin\draw.php on line 17
Does anyone see the error in my logic...I have gone over the code 1000 times and I don't see it. :eek: :confused:
Thanks in Advance,
Xman51