Afficher un message
Vieux 24/06/2007, 21h33   #1
gagal
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut having problem getting php to connect

Warning: mysql_query(): supplied argument is not a valid MySQL-Link
resource in /home/smith/public_html/personal/ab_functions.php on line
30

line 30 is [mysql_query ($sql, $connect) or die(mysql_error());]

function addPerson ()
{
$firstName = $_POST['firstName'];
$lastName = $_POST['lastName'];
if( $_POST{'dobMonth'} and $_POST{'dobDay'})
$dob = ($_POST{'dobMonth'}.'/'.$_POST{'dobDay'}.'/'.
$_POST{'dobYear'});
else
$dob = ' ';
$category = $_POST['category'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$city = $_POST['city'];
$state = $_POST['state'];
$zipcode = $_POST['zipcode'];
$telephone = $_POST['telephone'];
$cellphone = $_POST['cellphone'];
$email1 = $_POST['email1'];
$email2 = $_POST['email2'];
$aimid = $_POST['aimid'];
$url = $_POST['url'];
$notes = $_POST['notes'];

$sql = "INSERT INTO $db_table4
(firstName, lastName, dob, category, address1, address2, city,
state, zipcode, telephone, cellphone, email1, email2, aimid, url,
notes)
VALUES
('$firstName', '$lastName', '$dob', '$category', '$address1',
'$address2', '$city', '$state', '$zipcode', '$telephone',
'$cellphone', '$email1', '$email2', '$aimid', '$url', '$notes')";

mysql_query ($sql, $connect) or die(mysql_error());

echo "added";
}

function is called on this page

HTML>
<HEAD>
<?PHP include("includes/headsectionp.txt")?>
</HEAD>

<BODY>
<?PHP include("includes/connect.txt");?>
<?PHP include("ab_functions.php");?>
<?PHP
if(isset($_POST['do_addperson']))
{
addPerson ();
}
?>

  Réponse avec citation
 
Page generated in 0,05322 seconds with 9 queries