I Need Help !!!! ( well in many areas, but for now in PHP)
Posted: Sun Sep 18, 2005 7:14 pm
I need help. I'm sure it is something simple. I'm just not seeing it.
I am getting the following message when I try to connect to a MySQL db.
"Warning: mysql_connect(): Lost connection to MySQL server during query in /hsphere/local/home/willb/3pp.com/php3/MedProfiles/my_functions.php on line 22
Could not connect: Lost connection to MySQL server during query"
Here's my code;
JCART | Please use
I am getting the following message when I try to connect to a MySQL db.
"Warning: mysql_connect(): Lost connection to MySQL server during query in /hsphere/local/home/willb/3pp.com/php3/MedProfiles/my_functions.php on line 22
Could not connect: Lost connection to MySQL server during query"
Here's my code;
Code: Select all
<?php
$link = mysql_connect('the_correct_server_name', 'the_correct_uid', 'the_correct_psw'') or
die('Could not connect: ' . mysql_error());
mysql_select_db('willb_medprofiles', $link) or die ('Could find DB: ' . mysql_error());
include("my_functions.php");
$unique_id = unique_id();
$sql = "Insert into customer
(fname,
lname,
mid_intial,
social_security_num,
sex,
date_of_birth,
email,
address,
city,
state,
zip,
country,
phone,
cell,
DNR,
unique_id)
VALUES
('". $_Post['fname']."',
'". $_Post['lname']."',
'". $_Post['mid_intial']."',
'". $_Post['social_security_num']."',
'". $_Post['sex']."',
'". $_Post['date_of_birth']."',
'". $_Post['email']."',
'". $_Post['address']."',
'". $_Post['city']."',
'". $_Post['state']."',
'". $_Post['zip']."',
'". $_Post['country']."',
'". $_Post['phone']."',
'". $_Post['cell']."',
'". $_Post['DNR']."',
'$unique_id') ";
echo "DEBUG :" ;
echo $sql;
echo "<br>";
echo $unique_id ;
/*If (isset($sql) && !empty($sql)) {
$result = mysql_query($sql) or die("Invalid Query:" . mysql_error());
*/
?>JCART | Please use
Code: Select all
tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]