Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I have two columns in a table and I want to update them both using php. little help please [closed]
- <?php
- $dbhostname = "localhost";
- $dbusername = "root";
- $dbpassword = "";
- $connection = mysql_connect($dbhostname, $dbusername, $dbpassword);
- $desc=$_POST['desc'];
- $code=$_POST['code'];
- mysql_select_db("bedanshare");
- $up="UPDATE learning_material SET description='$desc', code='$code' WHERE code='$code'";
- mysql_query($up);
- if($up){
- echo "<script type="text/javascript">
- alert("Update Success!")
- history.back()
- </script>";
- }
- mysql_close($connection);
- ?>
Add Comment
Please, Sign In to add comment