Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- date_default_timezone_set('America/New_York');
- $connection = mysql_connect("ocelot.aul.fiu.edu","DBname","password");
- // Check connection
- if (!$connection)
- {
- echo "Connection failed: " . mysql_connect_error();
- }
- else
- {
- //select table
- mysql_select_db("DBname") or die(mysql_error());
- echo "Database Found! <br>";
- $StudentID = $_POST["StudentID"];
- $firstName = $_POST["firstName"];
- $lastName = $_POST["lastName"];
- $query = "UPDATE DBname.students
- SET firstName = '$firstName',
- lastName = '$lastName'
- WHERE StudentID = '$StudentID'";
- $res = mysql_query($query);
- if ($res)
- {
- echo "<p>Record Updated<p>";
- }
- else
- {
- echo "Problem updating record. MySQL Error: " . mysql_error();
- }
- }
- mysql_close($connection);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement