FreePaq MySQL
Jeg får denne fejlmeddelelse:Warning: Access denied for user: \'@www2.freepaq.dk\' (Using password: YES) in /usr/local/share/www/k/e/tatata.dk/exchange/adduser.php on line 33
Access denied for user: \'@www2.freepaq.dk\' (Using password: YES) Unable to connect
hvad er der galdt i denne kode?
<?
/*
******************************************************************************
* adduser.php Version 0.0.1 *
* Copyright 2000 Ari Shomair
* Created 27.OCT.2000 Last Modified 28.OCT.2000 9:25AM EST *
******************************************************************************
* COPYRIGHT NOTICE *
* Copyright 2000 Ari Shomair All Rights Reserved. *
* *
* This code may be used and modified free of charge by anyone so long as *
* this copyright notice and the comments above remain intact. By using this *
* code you agree to indemnify Ari Shomair from any liability that might *
* arise from its use. *
* *
* Selling the code for this program without prior written consent is *
* expressly forbidden. In other words, please ask first before you try and *
* make money off of my code. *
* --------------------------------------------------------- *
* In all cases of redistribution copyright and header must remain intact *
******************************************************************************
*/
// Load up the MySQL Config file
include(\"xchange.cfg\");
$server = \"mysql.infopaq.dk\";
$brugernavn = \"<ftp006403>\";
$password = \"<blah>\";
$db_navn = $brugernavn . \"_db\";
if (!mysql_pconnect($server, $brugernavn, $password)) {
echo mysql_error().\"\\n\";
die(\"Unable to connect\\n\");
}
mysql_select_db(\"$db_navn\")
or die(\"Unable to select db \".mysql_error().\"\\n\");
$result = mysql_query(\"CREATE TABLE Test (Test_UID int)\")
or die( \"Unable to connect to SQL server. Reason: \".mysql_error());
$result = mysql_query(\"INSERT INTO Test VALUES (2)\")
or die( \"Unable to connect to SQL server. Reason: \".mysql_error());
$result = mysql_query(\"SELECT * FROM Test\")
or die( \"Unable to connect to SQL server. Reason: \".mysql_error());
while ($row = mysql_fetch_array($result)) {
echo ($row[Test_UID] . \"<BR>\");
}
echo \"Færdig<BR>\";
mysql_close();
//Try to connect to database
mysql_connect(\"$dbhost\",\"$dbuser\",\"$dbpasswd\")
or die(\"Unable to connect to SQL server!\");
@mysql_select_db(\"$db\")
or die(\"Unable to select database!\");
echo($email);
//Enter the values into the database account\'s record from the MySql tabel
mysql_query(\"INSERT into $userdatabasetable (EMAIL, ACCT, TITLE, URL,
PASSWORD) VALUES (\'$EMAIL\',\'$ACCOUNT\',\'$TITLE\',\'$URL\',\'$PASSWORD\')\");
#$result = mysql_query(\"SELECT * from $table where acct=\\\"$acct\\\" and
date=\\\"$date\\\" \");
#$row = mysql_fetch_array($result);
#$lastipout = $row[\'LASTIPOUT\'];
Echo(\"<H1>User added successfully!</h1>\");
?>
-***************
I faqs på freepaq står der man skal gør sådan for at få forbindelse til databasen
<?
$server = \"mysql.infopaq.dk\";
$brugernavn = \"<dit brugernavn>\";
$password = \"<dit password>\";
$db_navn = $brugernavn . \"_db\";
if (!mysql_pconnect($server, $brugernavn, $password)) {
echo mysql_error().\"\\n\";
die(\"Unable to connect\\n\");
}
mysql_select_db(\"$db_navn\")
or die(\"Unable to select db \".mysql_error().\"\\n\");
$result = mysql_query(\"CREATE TABLE Test (Test_UID int)\")
or die( \"Unable to connect to SQL server. Reason: \".mysql_error());
$result = mysql_query(\"INSERT INTO Test VALUES (2)\")
or die( \"Unable to connect to SQL server. Reason: \".mysql_error());
$result = mysql_query(\"SELECT * FROM Test\")
or die( \"Unable to connect to SQL server. Reason: \".mysql_error());
while ($row = mysql_fetch_array($result)) {
echo ($row[Test_UID] . \"<BR>\");
}
echo \"Færdig<BR>\";
mysql_close();
?>
Kan i ikke lige opstille det hele sådan at jeg bare skal skrive mit password og username ?
