WesleyA Posted October 29, 2015 Share Posted October 29, 2015 (edited) This is my situation If variable $conn has all variables (with a value) $conn = new mysqli($servername, $username, $password, $dbname); and then you use var_dump($conn); and the output would be null of all the values of $conn. What would it mean? Am I right the connection then needs to be re-established? I'm doing 2 queries on a database. First query is SHOW TABLES then make the user choose a table value. From this value a new query is done. So first connection is done. But can I use this connection or should I make a new one? Edited October 29, 2015 by WesleyA Link to comment Share on other sites More sharing options...
justsomeguy Posted October 29, 2015 Share Posted October 29, 2015 var_dump just prints information about the variable, in that case it will print information about the mysqli object you created. It doesn't change the variable. You can use the same connection for as many queries as you want in a single request. Once the request ends then the connection will automatically close, you can't save connections between requests. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now