|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Mysql and PHP errors
Hi
Have a Database (Mysql) and some php-code but get this errors, when traying to use one of my forms: support When i fill out the form, i get this errors: Parse error: parse error in /home/team-it.biz/inc/settings.php on line 7 Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/team-it.biz/inc/n_supportsend.inc on line 8 Warning: mysql_db_query(): supplied argument is not a valid MySQL-Link resource in /home/team-it.biz/inc/n_supportsend.inc on line 11 Beklager, ingen kontakt med databasen, vennligst prøv senere. Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /home/team-it.biz/inc/n_supportsend.inc on line 16 INCLUDE MY SOURCE CODE Settings.php ********************************** <?php $Host = "localhost"; / can't show the real value $User = "user"; / can't show the real value $Password = "password"; / can't show the real value $DBName = "dbname"; /Can't show the real value $PW = "password"; /Can't show the real value <?php ?> /* $Host = "mysql.ccc"; /Can't show the real value $User = "user"; /Can't show the real value $Password = "password"; /Can't show the real value $DBName = "dbname"; /Can't show the real value $PW = "password"; /Can't show the real value */ ************************************** n_include.inc ************************************** <?php $Array["navn"] = trim ($Array["navn"]); $Array["mail"] = trim ($Array["mail"]); $Array["kat"] = trim ($Array["kat"]); $Array["text"] = trim ($Array["text"]); include ("inc/settings.php"); $TableName = "tools_support"; $Link = mysql_connect ($Host, $User, $Password); $Query = "INSERT into $TableName values ('$Array[navn]', '$Array[mail]', '$Array[kat]', '$Array[text]')"; //print ("Følgende Sql søk ble gjort : <br>$Query<p>\n"); // for feilsøking if (mysql_db_query ($DBName, $Query, $Link)) { print ("<b><br>Mange takk, din melding er sendt..<b><br>\n"); } else { print ("Beklager, ingen kontakt med databasen, vennligst prøv senere.<br>\n"); } mysql_close ($Link); ?> Please help me Thanks Tor ![]() |
|
#2
|
||||
|
||||
|
I'd guess your mysql server won't let you log in. Have you tried connecting at the command line using the credentials you're providing in your script?
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
|
#3
|
|||
|
|||
|
Why
Thanks for fast reply
I'd guess your mysql server won't let you log in. Have you tried connecting at the command line using the credentials you're providing in your script? How do you do this ??? Please help Thanks Tor |
|
#4
|
||||
|
||||
|
At a command prompt, you type mysql -u <username> -p -h <hostname>. This will prompt you for a password. If you can't connect using this method, then either mysql's not running or the user you're specifying isn't able to log in. In either case, you'll need to take the issue up with your host.
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > Mysql and PHP errors |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|