Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- mysql_connect("localhost" , "root" , "") or die("not connect");
- mysql_select_db("polic2") or die("not be found");
- if(isset($_POST['update'])) {
- $edit_record = $_GET['edit_form']; // changed to $edit_record;
- $name1 = $_POST['nameP1'];
- $addressP1 = $_POST['address1'];
- $ageP1 = $_POST['age1'];
- $telP1 = $_POST['tel1'];
- $jobP1 = $_POST['job1'];
- $tawanP1 = $_POST['tawan1'];
- $baseP1 = $_POST['base1'];
- $query1 = "update data set uname='$name1' , uaddress='$addressP1' , uage='$ageP1' ,
- utel='$telP1' , ujob='$jobP1' , utawan='$tawanP1' , ubase='$baseP1'
- where id='$edit_record'"; // changed to $edit_record;
- if(mysql_query($query1)) {
- echo "<script>window.open('view.php?updated=record has been updated','_self')</script>";
- }
- }
- if (ISSET($_GET['edit'])) {
- $edit_record = $_GET['edit'];
- }
- $query = "select * from data where id = '$edit_record'";
- $run=mysql_query($query);
- while($row=mysql_fetch_array($run)) {
- $edit_id=$row['id'];
- $e_name=$row[1];
- $e_address=$row[2];
- $e_age=$row[3];
- $e_tel=$row[4];
- $e_job=$row[5];
- $e_twana=$row[6];
- $e_base=$row[7];
- }
- ?>
- <html>
- <head>
- <title>Update data information</title>
- </head>
- <body>
- <form method='post' action='edit.php?edit_form=<?echo $edit_id;?>'>
- <table width="500" border="3" align='center'>
- <tr>
- <th bgcolor='yellow' colspan='5'>-:گۆڕانکاری کردنی زانیارییەکان</th>
- </tr>
- <tr>
- <td align='right'><input type='text' name='nameP1' value='<?php echo $e_name;?>' />
- </td>
- <td align='right' > ناوی سەرپێچیکار</td>
- </tr>
- <tr>
- <td align='right'><input type='text' name='address1' value='<?php echo $e_address;?>'/>
- </td>
- <td align='right'> شوینی نیشتەجێبوون</td>
- </tr>
- <tr>
- <td align='right'><input type='text' name='age1' value='<?php echo $e_age;?>' />
- </td>
- <td align='right'> تەمەن</td>
- </tr>
- <tr>
- <td align='right'><input type='text' name='tel1' value='<?php echo $e_tel;?>'/>
- </td>
- <td align='right'> ژمارەی مۆبایل</td>
- </tr>
- <tr>
- <td align='right'><input type='text' name='job1' value='<?php echo $e_job;?>'>
- </td>
- <td align='right'> کار</td>
- </tr>
- <tr>
- <td align='right'><input type='text' name='tawan1' value='<?php echo $e_twana;?>' />
- </td>
- <td align='right'> سەرپێچی</td>
- </tr>
- <tr width='500'>
- <td align='right'>
- <select name='base1'>
- <option value='<?php echo $e_base;?>'>
- <?php echo $e_base;?>
- </option>
- <option value='ranya'>ڕانیە</option>
- <option value='qaladzy'>قەلادزێ</option>
- <option value='chwargwrna'>چوارقورنە</option>
- <option value='hajyawa'>حاجیاوا</option>
- </select>
- </td>
- <td align='right'> بنکەی دەستگیرکردن</td>
- </tr>
- <tr>
- <td align='center' colspan='5'>
- <input type='submit' name='update' value='گۆڕانکاری' />
- </td>
- </tr>
- </table>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement