Jump to content

PHP UPDATE


karnegyhall

Recommended Posts

<?php

$conn = mysql_connect("**********.3869157.hostedresource.com", "[database]", "password"); 

if (!$conn)
{
  die('Could not connect: ' . mysql_error());
}

$select = mysql_select_db('sportstalkadmin', $conn);

if (!$select)
{
  die('could not select db: sportstalkadmin ' . mysql_error());
}

$ID = $_SESSION['SESS_MEMBER_ID'];

<?php $login = $_POST['Login']?><br />;
<?php $lname = $_POST['Lname']?><br />;
<?php $fname = $_POST['Fname']?><br />;
<?php $jersey = $_POST['Jersey']?><br />;
<?php $height = $_POST['Height']?><br />;
<?php $weight = $_POST['Weight']?><br />;
<?php $email = $_POST['Email']?><br />;


$update = mysql_query("UPDATE tblathletes SET strEMailAddress = '$email'
WHERE intAthleteID = '$ID'");



if (!$update)
{header("location: sports-memberindex.php");
	exit();
}
die('Could not post your data: ' . mysql_error());
}

mysql_close($con);

 

the script processes and does not die.  But when i go to the DB and do a SELECT statement on any of the fields i'm sending in the form.  They're not there.

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/159845-php-update/
Share on other sites

<?php
$conn = mysql_connect
("********.db.3869157.hostedresource.com", 
"[database]", "[Password]"); 
if (!$conn)
{
  die('Could not connect: ' . mysql_error());
}
$select = mysql_select_db('sportstalkadmin', $conn);
if (!$select)
{
  die('could not select db: sportstalkadmin ' . mysql_error());
}
$ID = $_SESSION['SESS_MEMBER_ID'];
?>
<?php $login = $_POST['Login']?><br />;
<?php $lname = $_POST['Lname']?><br />;
<?php $fname = $_POST['Fname']?><br />;
<?php $jersey = $_POST['Jersey']?><br />;
<?php $height = $_POST['Height']?><br />;
<?php $weight = $_POST['Weight']?><br />;
<?php $email = $_POST['Email']?><br />;
<?php
$update = mysql_query(UPDATE tblathletes SET 
strEMailAddress='$email'
WHERE intAthleteID='$ID');
if (!$update)
{header("location: sports-memberindex.php");
	exit();
}
die('Could not post your data: ' . mysql_error());
}
mysql_close($con);
?>

 

i hear what you're saying, but unfortunately I get the same result despite the change.  the page processes to the header page, but the db does not reflect the update sent from my form.

Link to comment
https://forums.phpfreaks.com/topic/159845-php-update/#findComment-843293
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.