Jump to content

ksgush

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ksgush's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I fixed the problem. when defining the variable: xmlHttp I should have defined it a second name on the second call.
  2. I write backend management php apps. I am trying to impliment some ajax features. I am using the below code to retrieve info from a database when the page loads up automatically, then ever 10,12 seconds thereafter, if there is a certain part in the database shows one image and throws it back into the page, and if another type of info, it throws another image back into the page. The problem is, the code I am using, uses the body's onLoad function, I recently had 3 calls to the server working correctly, i changed a few things, and now only 1 call will work at a time. If anybody has any suggestions on this code or any ideas to my fix, please let me know. <script language="javascript" type="text/javascript"> <!-- if (window.XMLHttpRequest){ var xmlHttp = new XMLHttpRequest() } else if (window.ActiveXObject){ var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } function updateLeadCredit(type,recid){ var url = "ajax.php?type=" + type + "&recid=" + recid + "&ms=" + new Date().getTime(); xmlHttp.open("GET", url, true); xmlHttp.onreadystatechange = updateCreditText; xmlHttp.send(null); } function updateCreditText(){ if(xmlHttp.readyState == 4){ var response = xmlHttp.responseText; document.getElementById("lead_credit_text").innerHTML = response; } } //--> </script> <script language="javascript" type="text/javascript"> <!-- if (window.XMLHttpRequest){ var xmlHttp = new XMLHttpRequest() } else if (window.ActiveXObject){ var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } function queueCall(){ var url2 = "ajax_alert.php?type=queue&auth_memid=<?php echo $auth_memid; ?>&ms=" + new Date().getTime(); xmlHttp.open("GET", url2, true); xmlHttp.onreadystatechange = updateQueueCall; xmlHttp.send(null); } function updateQueueCall(){ if(xmlHttp.readyState == 4){ var response = xmlHttp.responseText; document.getElementById("queue").innerHTML = response; setTimeout("queueCall()",12000); } } //--> </script> <script language="javascript" type="text/javascript"> <!-- if (window.XMLHttpRequest){ var xmlHttp = new XMLHttpRequest() } else if (window.ActiveXObject){ var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } function wwwCall(){ var url = "ajax_alert.php?type=www&ms=" + new Date().getTime(); xmlHttp.open("GET", url, true); xmlHttp.onreadystatechange = updatewwwCall; xmlHttp.send(null); } function updatewwwCall(){ if(xmlHttp.readyState == 4){ var response = xmlHttp.responseText; document.getElementById("wwwincoming").innerHTML = response; setTimeout("wwwCall()",10000); } } //--> </script> <body onLoad="wwwCall();queueCall();<?php if(eregi("lead.php",$_SERVER['PHP_SELF'])==TRUE){echo "updateLeadCredit('','$recid');";} ?>"> <span id="queue"> </span> <span id="wwwincoming"> </span>
  3. Anybody has any suggestions ? Please, and thank you.
  4. The databases arranged this way for different operations and origanizational purposes i guess. My predecessor had things this way.. it isn't the best.. but it is what I have to work with.
  5. ??? ??? ??? ??? ??? Hi, New Member Here... Was wondering if anyone had any clues on to how I could do this same thing but a hell of alot simpler.... Right now it doesn't return anything.. not even in view source.. But I contribute that to so many open connections, and someplace i know it probably broke.. The purpose of this little script is to take look at orders in a mssql db, than jump through the other db's to find the information it needs to find out if the Quantity on hand is more or equal to than the quantity the customer wants to order. Here is the idea in another way. <?php include("config.php"); $connect1_dbhandle = mssql_connect($connect1_SERVER, $connect1_USER, $connect1_PASS) or die("Couldn't connect to SQL Server on $connect1_SERVER"); $connect1_selected = mssql_select_db($connect1_DB, $connect1_dbhandle) or die("Couldn't open database $connect1_DB"); $connect1_query = "SELECT CartID "; $connect1_query .= "FROM WSTCompOrders "; $connect1_query .= "WHERE (NOT (OrderStatus = '6')) AND (NOT (OrderStatus = '5')) AND (NOT (OrderStatus = '4'))"; $connect1_result = mssql_query($connect1_query); while($connect1_row = mssql_fetch_array($connect1_result)) { $part2_dbhandle = mssql_connect($connect1_SERVER, $connect1_USER, $connect1_PASS) or die("Couldn't connect to SQL Server on $connect1_SERVER"); $part2_selected = mssql_select_db($connect1_DB, $part2_dbhandle) or die("Couldn't open database $connect1_DB"); $part2_query = "SELECT Quantity, ProductID, OrderNumber "; $part2_query .= "FROM WSTCart "; $part2_query .= "WHERE OrderNumber = '" . $connect1_row["CartID"] . "'"; $part2_result = mssql_query($part2_query); while($part2_row = mssql_fetch_array($part2_result)) { $PRODUCTS_dbhandle = mssql_connect($connect1_SERVER, $connect1_USER, $connect1_PASS) or die("Couldn't connect to SQL Server on $connect1_SERVER"); $PRODUCTS_selected = mssql_select_db($connect1_DB, $PRODUCTS_dbhandle) or die("Couldn't open database $connect1_DB"); $PRODUCTS_query = "SELECT ManPartNumbers "; $PRODUCTS_query .= "FROM Products "; $PRODUCTS_query .= "WHERE ID = '" . $part2_row["ProductID"] . "'"; $PRODUCTS_result = mssql_query($PRODUCTS_query); while($PRODUCTS_row = mssql_fetch_array($PRODUCTS_result)) { $RMS_dbhandle = mssql_connect($connect2_SERVER, $connect2_USER, $connect2_PASS) or die("Couldn't connect to SQL Server on $connect2_SERVER"); $RMS_selected = mssql_select_db($connect2_DB, $RMS_dbhandle) or die("Couldn't open database $connect2_DB"); $RMS_query = "SELECT Quantity "; $RMS_query .= "FROM rmsBetaDB "; $RMS_query .= "WHERE ItemLookupCode = '" . $PRODUCTS_row["ManPartNumbers"] . "'"; $RMS_result = mssql_query($RMS_query); while($RMS_row = mssql_fetch_array($RMS_result)) { if( $RMS_row["Quantity"] >= $part2_row["Quantity"] ) { echo $connect1_row["CartID"] . "should be shipped<br><br><br>"; } else { } } } } } ?>
  6. Hi... I never used MySQL database that much needless to say MSSQL so, bear with me. I have this code, and it's not working.. can anyone see anything wrong with it ?? I am not getting any errors, my page is blank and my source view is empty with standard html tags. [code] <?php $myServer = "888.88.88.888"; $myUser = "888888"; $myPass = "8888888"; $myDB = "888888"; $dbhandle = mssql_connect($myServer, $myUser, $myPass)   //select a database to work with $selected = mssql_select_db($myDB, $dbhandle) or die("Couldn't open database $myDB"); //declare the SQL statement that will query the database $query = "SELECT CartID FROM WSTOrders;"; $selected = mssql_query($query); $numRows = mssql_num_rows($selected); echo "<h1>" . $numRows . " Row" . ($numRows == 1 ? "" : "s") . " Returned </h1>"; //display the results while($row = mssql_fetch_array($selected)) {   echo $row["CartID"] . ""; } ?> [/code] Any and much help appreciated..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.