Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $hostname="localhost";
- $databasename="editoncms";
- $username="root";
- $password="PASSWORT";
- try
- {
- $dbhandler=new PDO('mysql:host='.$hostname.';dbame='.$databasename,$username,$password);
- $dbhandler->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
- }
- catch(PDOException $errormsg)
- {
- die($errormsg->getMessage());
- }
- echo"Databse Connected to MySQL!";
- require 'include/bdconnect.php';
- $id=$_GET['edit'];
- // i am fetching id from other page by clicking on edit button.
- if(isset($_GET['edit'])){
- $SQL=$dbhandler->prepare("SELECT * FROM banner WHERE id=?, Title=?, seo=?, images=?");
- $SQL->bindParam(1, $id, PDO::PARAM_INT);
- $SQL->bindParam(2, $title, PDO::PARAM_STR);
- $SQL->bindParam(3, $seo, PDO::PARAM_STR);;
- $SQL->bindParam(4, $img_final, PDO::PARAM_STR);
- $SQL->execute();
- }
- <body>
- <div class="cont">
- <form action="" method="post" enctype="multipart/form-data">
- <input class="input-text" type="text" name="title" value="<?PHP print $title ; ?>" />
- <input class="input-text" type="text" name="seo" value="<?PHP print $seo ; ?>" />
- <input class="upload-img" type="file" name="imgupload" >
- <input class="submit-btn" type="submit" name="update" value="UPDATE BANNER" />
- </form>
- <p style="color:#FFF; clear:both; font-size:14px; margin-top:80px; line-height:0;">Current Image :</p><img src="../images/<?PHP print $img_final ; ?>" width="256" height="110" alt="" style="background:#FFF; padding:2px; margin:0;">
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement