jcanker Posted April 29, 2011 Share Posted April 29, 2011 Maybe this is really a php question, but since it's driving mySql, I'm asking here. I've created a command-line web interface to one of my MySql servers for my students to use instead of trying jump through all the hoops of getting the school's IT staff to install the client on all the lab pcs. I need a way to "deselect" the database that the student created. I've tried destroying the php session cookie that stores the db as a variable, but even after that happens I can still do a "show tables" command in the CLI and it shows the tables from the database the student was last using. That destruction process also includes mysql_close(), but the db is still selected. How can I clear that out so it's like they're freshly connecting to the MySQL client? Quote Link to comment https://forums.phpfreaks.com/topic/235047-how-to-unselect-a-database/ Share on other sites More sharing options...
mellis95 Posted April 29, 2011 Share Posted April 29, 2011 How are you closing the connection? Are you closing it by specifying the link_identifier? What does the code look like? Quote Link to comment https://forums.phpfreaks.com/topic/235047-how-to-unselect-a-database/#findComment-1208006 Share on other sites More sharing options...
jcanker Posted April 29, 2011 Author Share Posted April 29, 2011 Thanks for responding. I found the issue last last night; there was a pconnect hiding inside one of the include files. Once I changed that to mysql_connect() it started working as expected. mysql_pconnect() won't close even if you use a close Quote Link to comment https://forums.phpfreaks.com/topic/235047-how-to-unselect-a-database/#findComment-1208108 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.