Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP script stops running - possible bug?

Status
Not open for further replies.

MJAZ

Programmer
Aug 1, 2006
73
US
I have a PHP script with much repeated code that works fine - but not until I reach this function:

Code:
    function deleteCommentAction() {
        $db = new Database;
        $con = $db->db_connect('removal'); //right here
        mysql_select_db("theatheistconservative", $con);
        $query = "DELETE FROM blog_comments WHERE id='{$_GET["commentid"]}'";
        mysql_query($query, $con)|| die("Query error: ".mysql_error($con));
        
        $pages = new UIPages;
        $pages->checkCommentsPage("The comment has been deleted.");
    }

After the line marked "right here", the scripts stops running altogether. No error message is displayed. Any output (I put print and echo statements after it) does not get displayed after that line, nor does any function execute. There is no error in my server logs. I have that kind of Database setup throughout my script, and only on that function does it fail. Any ideas on whether it is a PHP bug or some wrongdoing on my part and if so how I can correct it? I am running PHP5 on Windows, but it will be ported to a Linux system later.
 
Without knowingf the exact contents of the db_connect() function, i can only guess, that the operator "removal" is calling a part of the function that kills the db connection, and ends the script, maybe using exit() or something similar. It could also mean its hanging at the removal part of the function.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top