Question

the below error i m getting:

Warning: mysql_select_db(): Access denied for user 'nativepl'@'localhost' (using password: NO) in /home/nativepl/public_html/testing/search.php on line 177

Warning: mysql_select_db(): A link to the server could not be established in /home/nativepl/public_html/testing/search.php on line 177 Access denied for user 'nativepl'@'localhost' (using password: NO)

user: nativepl_search pwd:fun@123 database:nativepl_native table:search

 mysql_connect("localhost","nativepl_search","fun@123") or die("Error connecting to database: ".mysql_error());

 mysql_select_db("nativepl_native") or die(mysql_error());
Was it helpful?

Solution

Try This...

     $db = mysql_connect("localhost","nativepl_search","fun@123") or 
                  die("Error connecting to database: ".mysql_error());

     mysql_select_db("nativepl_native",$db) or die(mysql_error());

OTHER TIPS

The code you are showing above is incomplete. You probably have another line like mysql_connect("localhost","nativepl"); in between the two lines that you show above.

Or it can also be inside some function or include that you call in between those two lines.

Find it and remove it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top