javascript - php returns error after successfully dropping my table -
Unless I try to drop a table, I'm successfully getting data from a database. Drops, but I can not understand how JavaScript can be used by declaring Ajax data base as an error.
How can I recover, when there is no data to return?
The following php routines exclude a table named tableNameInput that removes a line in the table, the inspection of the database shows that both operations were successfully executed but with javascript ajax error processing x.status = 0 Has gone. I need JavaScript Ajax to say that it's really full.
function dropCartTable ($ tableNameInput) {/ * cart table and its command entry * / AnnLog ("DropCartTable:", $ tableNameInput); // First drop the reference in the Order table tableName = "Order"; $ Query = "$ tableName remove cartDB = '$ tableNameInput'"; $ Result = doQuery ($ tableName, $ query, "command line could not drop"); If ($ result) {// Now drop this cart's table $ sql = "drop table if $ tableNameInput exists"; } // ******** The query only queries and logs if it dies, then it does not return $ Result = doQuery ($ tableName, $ sql, "CSRT table can not be dropped"); If ($ result) {/ ******} When we arrive here, we have successfully removed the item below, I tried to generate a response and it does not work. * / $ Arr = array ('drop cart' => 0); $ J = json_encode ($ arr); Echo \ json_encode ($ j); Analog ("resonant", $ J); / * It writes my logs that confirms that all the steps are fine until the return is completed. * Thanks in advance for your help. /> Drop downtype ($ tableNameInput) drop cart and its order entry * / p>
analog ("DropCartTable:", $ Tommy input); // First drop the reference in the order table table table = name = "order"; $ Query = "$ tableName remove cartDB = '$ tableNameInput'"; $ Result = doQuery ($ tableName, $ query, "command line could not drop"); If ($ result) {// Now drop this cart's table $ sql = "drop table if $ tableNameInput exists"; $ Arr = array ('drop cart' => gt; 0); $ J = json_encode ($ arr); Echo \ json_encode ($ j); Analog ("resonant", $ J); / * It writes my logs that confirms that all the steps are fine until the return is correct. * /} Other {$ arr = array ("Can not drop cart" => 0); $ J = json_encode ($ arr); Echo \ json_encode ($ j); The problem was that you want to leave the table and if the results are incorrect and ignoring, < P>
Comments
Post a Comment