mysql querry error
Posted: Wed Jun 01, 2005 9:33 pm
for some reason when i connect i get this error
Connected successfully
Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/www/twarowsk.freeownhost.com/StreetLife/process.php on line 7
Warning: mysql_query(): A link to the server could not be established in /home/www/twarowsk.freeownhost.com/StreetLife/process.php on line 7
this is my code:
and this is dblink.php:
thanks,
matt
Connected successfully
Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/www/twarowsk.freeownhost.com/StreetLife/process.php on line 7
Warning: mysql_query(): A link to the server could not be established in /home/www/twarowsk.freeownhost.com/StreetLife/process.php on line 7
this is my code:
Code: Select all
<?PHP
require('dblink.php');
//mysql query
$query = 'INSERT INTO member (username, password, email address) VALUES ("'.$_POST[loginName].'", "'.$_POST[password].'", "'.$_POST[email].'")';
$db_query = mysql_query($query);
$to = $_POST['Email'];//the email address the user submitted
$subject = 'You Registered!';
$message = 'You have just registered to play on The Streets. To log in go to the main page and use your username and password to sign in.';//the body of the email you are sending
mail($to, $subject, $message);//mail sent
?>Code: Select all
<?php
$link = mysql_connect('127.0.0.1', 'twarowsk_newdata@freeownhost.com', '********');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>matt