Sriram05 Posted June 12, 2022 Share Posted June 12, 2022 Fatal error: Uncaught ArgumentCountError: mysqli_select_db() expects exactly 2 arguments, 1 given in C:\xampp\htdocs\project\login.php:9 Stack trace: #0 C:\xampp\htdocs\project\login.php(9): mysqli_select_db('demo') #1 {main} thrown in C:\xampp\htdocs\project\login.php on line 9 I'm getting this error Quote Link to comment https://forums.phpfreaks.com/topic/314917-phpmyadmin-problem/ Share on other sites More sharing options...
ginerjm Posted June 12, 2022 Share Posted June 12, 2022 HOw is this related to phpadmin? And if you want help, show us the code that the message is pointing to.(and maybe a few lines before that) Quote Link to comment https://forums.phpfreaks.com/topic/314917-phpmyadmin-problem/#findComment-1597207 Share on other sites More sharing options...
mac_gyver Posted June 12, 2022 Share Posted June 12, 2022 that's not the correct call-time parameter usage for the msyqli_select_db() statement. the correct usage can be found in the php.net documentation. you can also select the database when you make the connection now, so there's generally no need to use a separate select db statement. if you arrived at this point by trying to convert old mysql_ based code to use the mysqli extension, simply by adding an 'i' to the function calls, this does not work. you must actually learn the correct usage for the mysqli statements. if you are converting old mysql_ based code, it is simpler and much better to skip over using the mysqli extension and use the PDO extension, because a huge problem with converting old code is the lack of security against sql special characters in data values breaking the sql query syntax, which is how sql injection is accomplished. the simplest way of adding security for all data types is to use a prepared query, which is very simple with the PDO extension, but more complicated and inconsistently handled with the mysqli extension. 1 Quote Link to comment https://forums.phpfreaks.com/topic/314917-phpmyadmin-problem/#findComment-1597208 Share on other sites More sharing options...
ginerjm Posted June 12, 2022 Share Posted June 12, 2022 If what Mac_gyver says is true then I totally agree. Read the manual and look at the examples for using PDO instead of mysqli. Better choice and pretty easy. Quote Link to comment https://forums.phpfreaks.com/topic/314917-phpmyadmin-problem/#findComment-1597209 Share on other sites More sharing options...
ginerjm Posted June 12, 2022 Share Posted June 12, 2022 We are more than willing to give you some help but can't do it without seeing that code. ?? Quote Link to comment https://forums.phpfreaks.com/topic/314917-phpmyadmin-problem/#findComment-1597211 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.