Jump to content

Recommended Posts

Not Updating... Not sure why...

 

<?
$id = $_GET["id"];

$facpr = $_GET["facpr"];
?>

<?php
$username = "*****";
$password = "*****";
$hostname = "localhost";

$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "Connected to Server<br>";

$selected = mysql_select_db("*****",$dbhandle)
or die("Can not open SLC Database");
echo "Connected to Salt Lake City Database<p>";

mysql_query("UPDATE training SET firstaidcpr = '$facpr' WHERE id='$id'");

echo "Database has been updated. You will be returned to the training page momentarily. <meta http-equiv='refresh' content='3;URL=training.php' >"

?>

<html>
<head>
<title>Database is Updating...</title>
</head>


<body bgcolor="#FFFFFF">

</body>


</html>

Link to comment
https://forums.phpfreaks.com/topic/101430-solved-not-updating/
Share on other sites

Didn't do the trick.

 


$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "Connected to Server<br>";

mysql_select_db("clintona_SLC",$dbhandle)
or die("Can not open SLC Database");
echo "Connected to Salt Lake City Database<p>";

mysql_query("UPDATE training SET firstaidcpr = $facpr WHERE id=$id");

echo "Database has been updated. You will be returned to the training page momentarily. <meta http-equiv='refresh' content='3;URL=training.php' >"

?>

<html>
<head>
<title>Database is Updating...</title>
</head>


<body bgcolor="#FFFFFF">

</body>


</html>

Link to comment
https://forums.phpfreaks.com/topic/101430-solved-not-updating/#findComment-518817
Share on other sites

<html>
<head>
<title>Database is Updating...</title>
</head>
<?php
$id = $_GET["id"];

$facpr = $_GET["facpr"];
?>
<body bgcolor="#FFFFFF">
<?php
$username = "root";
$password = "*****"; //gotta love the fact I left the real password in there. glad it's just a test box. gotta change it now.
$hostname = "localhost";
$dbhandle = mysql_connect($hostname, $username, $password);
echo "Connected to Server<br>";
mysql_select_db("testing",$dbhandle);
echo "Connected to Salt Lake City Database<p>";

mysql_query("UPDATE training SET firstaidcpr = '$facpr' WHERE id='$id'");

echo "Database has been updated. You will be returned to the training page momentarily. <meta http-equiv='refresh' content='3;URL=training.php' >"

?>
</body>
</html>

works great for me. I had it updating a test user just fine for me.

Link to comment
https://forums.phpfreaks.com/topic/101430-solved-not-updating/#findComment-518837
Share on other sites

Wow thanks. That will help out I'm sure. Question about that... when I do that I get the result

 

2007- 04-12

 

There is a space between the - and the 04 and my DB is still not updating. Anyway to get rid of that space? I was just trying to mess with the code but can's seem to figure it out.

Link to comment
https://forums.phpfreaks.com/topic/101430-solved-not-updating/#findComment-518840
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.