This is my first post on this form so please bear with me if i don't give all the needed info. My problem seems simple but i googled for hours and have not yet found anything that can help with my problem at all.
It is hard for me to explain but basically...
I have a function that uses PEAR DB to connect to mysql and display a table from the database. Then the user submits a change in the table and this sends it to a different php file that then uses PEAR to update the database and then calls the function again to display the next table in the database that is to be reviewed/updated/viewed.
the problem is the first time the function is called it connects to the database just fine and everything works smoothly and i echo "Table Updated" and close the connection to the database. In the same php file that updated the database i then try to call the function again to display the next table to be updated but it comes up with the error "connect failed"
i can't understand why the function connects and works just fine the first time but when i try to call it again it just doesn't work. After each connection to the database i use $connection->disconnect() ; to ensure that i don't have multiple connections open because i thought that may be the problem...
i have also had a few problems with require_once... . should it not matter at all how many times you require_once('D B.php')?? i require_once('D B.php') inside each function....
i have been going crazy trying to get this code to work and I just can't make sense out of why the connection fails the second time and not the first!
could there be a problem with the require_once('D B.php') being in the code twice... once at the top of the new file and the second time in the function that i am calling??
help!!! any ideas i would like to hear them... im new to this!
It is hard for me to explain but basically...
I have a function that uses PEAR DB to connect to mysql and display a table from the database. Then the user submits a change in the table and this sends it to a different php file that then uses PEAR to update the database and then calls the function again to display the next table in the database that is to be reviewed/updated/viewed.
the problem is the first time the function is called it connects to the database just fine and everything works smoothly and i echo "Table Updated" and close the connection to the database. In the same php file that updated the database i then try to call the function again to display the next table to be updated but it comes up with the error "connect failed"
i can't understand why the function connects and works just fine the first time but when i try to call it again it just doesn't work. After each connection to the database i use $connection->disconnect() ; to ensure that i don't have multiple connections open because i thought that may be the problem...
i have also had a few problems with require_once... . should it not matter at all how many times you require_once('D B.php')?? i require_once('D B.php') inside each function....
i have been going crazy trying to get this code to work and I just can't make sense out of why the connection fails the second time and not the first!
could there be a problem with the require_once('D B.php') being in the code twice... once at the top of the new file and the second time in the function that i am calling??
help!!! any ideas i would like to hear them... im new to this!
Comment