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());
Domanda
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());
Soluzione
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());
Altri suggerimenti
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.