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 Link to comment https://forums.phpfreaks.com/topic/287994-mysqli-error-mysqlioptions/ Share on other sites More sharing options...
timothyarden Posted April 24, 2014 Author 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.) 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. 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. Link to comment https://forums.phpfreaks.com/topic/287994-mysqli-error-mysqlioptions/#findComment-1477240 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.