Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/314917-phpmyadmin-problem/
Share on other sites

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.

  • Like 1
Link to comment
https://forums.phpfreaks.com/topic/314917-phpmyadmin-problem/#findComment-1597208
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.