sql - edit php doesn't work it doesn't update data -


my php doesn't update data. here code:

<html> <body> <meta charset="utf-8"> <title>სატელეფონო ცნობარი</title> <?php include('connection.php');  if(isset($_get['id'])) {     $id=$_get['id'];     if(isset($_post['submit'])) {         $tarigi=$_post['addedon'];                          $teleponi2=$_post['tel2'];                                                        $teleponi3=$_post['tel3'];         $departamenti2=$_post['department2'];         $departamenti3=$_post['department3'];         $web=$_post ['url'];         $email=$_post['email'];         $address=$_post['address'];         $comment=$_post['comment'];         $query3=mysql_query("update phonebook set addedon='$tarigi', tel2='$teleponi2',tel3='$teleponi3', department2='$departamenti2' , department3='$departamenti3' url='$web', email='$email', address='$address', comment='$comment' id=$id");          if($query3) {                 header('location:listcnobari.php');         }     }     $query1=mysql_query("select * phonebook id='$id'");         $query2=mysql_fetch_array($query1); ?>  <fieldset style="width:325px;">     <form method="post" action="">         დამატების თარიღი:<input type="text" name="addedon" value="<?php echo $query2['addedon']; ?>" /><br />         ტელეფონი2:<input type="text" name="tel2" value="<?php echo $query2['tel2']; ?>" /><br />         ტელეფონი3:<input type="text" name="tel3" value="<?php echo $query2['tel3']; ?>" /><br>         დეპარტამენტი2:<input type="text" name="department2" value="<?php echo $query2['department2']; ?>" /><br />         დეპარტამენტი3:<input type="text" name="department3" value="<?php echo $query2['department3']; ?>" /><br />         ვებ.გვერდი:<input type="text" name="url" value="<?php echo $query2['url']; ?>" /><br />         ელ.ფოსტა:<input type="text" name="email" value="<?php echo $query2['email']; ?>" /><br />         მისამართი:<input type="text" name="address" value="<?php echo $query2['address']; ?>" /><br />         კომენტარი:<input type="text" name="comment" value="<?php echo $query2['comment']; ?>" /><br />          <input type="submit" name="submit" value="update" />     </form> <?php } ?> </body> </html> 

change query to

$query3=mysql_query("update phonebook set addedon='$tarigi', tel2='$teleponi2',              tel3='$teleponi3', department2='$departamenti2' , department3='$departamenti3', url='$web', email='$email',              address='$address', comment='$comment' id=$id"); 

you missed comma

department3='$departamenti3' url='$web' 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -