timothyarden Posted April 24, 2014 Share Posted April 24, 2014 $DatabaseConnection -> options( "MYSQLI_OPT_CONNECT_TIMEOUT", 300 ); Does anyone know why this code is getting this error warning: Warning: mysqli::options() expects parameter 1 to be long, string given in... (definitely this line) This didnt help me: http://www.php.net/manual/en/mysqli.options.php Quote Link to comment https://forums.phpfreaks.com/topic/287994-mysqli-error-mysqlioptions/ Share on other sites More sharing options...
Solution timothyarden Posted April 24, 2014 Author Solution Share Posted April 24, 2014 I removed the invereted commas arround MYSQLI_OPT_CONNECT_TIMEOUT and the warning is gone - is that how it should be? (I got the code off a website.) Quote Link to comment https://forums.phpfreaks.com/topic/287994-mysqli-error-mysqlioptions/#findComment-1477185 Share on other sites More sharing options...
Jacques1 Posted April 24, 2014 Share Posted April 24, 2014 Do you have any reason for setting this option at runtime? If you've just copied it from that website without understanding what it does, remove it. Quote Link to comment https://forums.phpfreaks.com/topic/287994-mysqli-error-mysqlioptions/#findComment-1477187 Share on other sites More sharing options...
timothyarden Posted April 25, 2014 Author Share Posted April 25, 2014 I guess there isn't any real reason for setting it in the script. I understand what it does though; setting the MySQLi connection to, when it sends queries to the database, have a max of 5 minutes before it times out. Quote Link to comment https://forums.phpfreaks.com/topic/287994-mysqli-error-mysqlioptions/#findComment-1477240 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.