MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 13th, 2004, 09:22 AM
torberg torberg is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 torberg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old April 13th, 2004, 10:54 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
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.

Reply With Quote
  #3  
Old April 13th, 2004, 12:36 PM
torberg torberg is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 torberg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old April 13th, 2004, 01:41 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Mysql and PHP errors


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT