Quote:
Originally Posted by maxxximus
Localhost should have been in quotes. If the database is local then localhost is correct. This should work.
PHP Code:
<?php $username=""; $password=""; $database="local_db"; $host="localhost"; $connection = mysql_connect($host,$username,$password); mysql_select_db($database,$connection) or die( "Unable to select database"); $query = "INSERT INTO contacts VALUES ('','John','Smith','01234 567890','00112 334455','01234 567891','johnsmith@gowansnet.com','http://www.gowansnet.com')"; mysql_query($query); mysql_close(); ?>
|
Using your code (thank you!) I get this error message:
Warning: mysql_connect(): Access denied for user 'ODBC'@'localhost' (using password: NO) in c:\program files\easyphp1-8\www\new folder\load_contacts.php on line 6
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in c:\program files\easyphp1-8\www\new folder\load_contacts.php on line 7
Unable to select database
I need to find out my username and password don't I! Is that it? 
|