php - update query not work -


this full code of page using update data.i tried many time still not updating values in database..also tried echo still not updating

<?php session_start(); include '../func-tion/func.php'; if(isset($_session['m_uname']) && isset($_session['m_pass'])) {  ?> <?php if(isset($_post['subup'])) { $sql="update appid set android_appid='".$_post['and_a']."' , iphone_appid='".$_post['iph_a']."' , ipad_appid='".$_post['ipa_a']."' u_name='".$_get['name']."'"; echo $sql; } ?>    <?php                 $main_qry=mysql_query("select * users u_name='".$_get['name']."'");               $main_fetch=mysql_fetch_assoc($main_qry);   ?>  <center><h2 class="art-postheader">edit details of <b></b></h2></center><br/><br/>  <table align="center">    <tr align="center">   <td style="height: 60px; font-family: helvetica,arial,sans-serif; font-weight: bold;">username:<br>  <input type="text" name="u_name" style="width: 300px;" value="<?php echo $main_fetch['u_name']?>"></td>  </tr>  <tr align="center">   <td style="height: 60px; font-family: helvetica,arial,sans-serif; font-weight: bold;">email:<br>   <input type="text" name="u_email" style="width: 300px;" value="<?php echo $main_fetch['u_email']?>"></td> </tr><?php                 $main_qrys=mysql_query("select * appid u_name='".$_get['name']."'");               $row=mysql_fetch_assoc($main_qrys);   ?>      <form name="user" method="post" action="users_edit.php" onsubmit="return valid();">  <tr align="center"> <td  style="width: 100px; font-family: helvetica,arial,sans-serif; font-weight: bold;">android appid:<br>   <input type="text" name="and_a" style="width: 300px;" value="<?php echo $row['android_appid']?>"></td>  </tr>  <tr align="center"> <td  style="width: 100px; font-family: helvetica,arial,sans-serif; font-weight: bold;">iphone appid:<br>   <input type="text" name="iph_a" style="width: 300px;" value="<?php echo $row['iphone_appid']?>"></td>  </tr>  <tr align="center"> <td  style="width: 100px; font-family: helvetica,arial,sans-serif; font-weight: bold;">iphone(ipad) appid:<br>   <input type="text" name="ipa_a" style="width: 300px;" value="<?php echo $row['ipad_appid']?>"></td>  </tr> <tr align="center">   <td style="height: 28px;">   <button name="subup" type="submit">edit</button>   </td> </tr> </form>  </table>    </div>                 </div>             </div>         </div>  </div>  </body></html>  <?php  } else { header("location:notserver.php?l=fake"); } ?> 

if know..please me thankfull him

use query:

update appid  set android_appid='$android_appid', iphone_appid='$iphone_appid', ipad_appid='$ipad_appid' u_name in (select u_name users u_id = $_get[id]) 

i wonder why you're using $_get['id'] rather $_post['id'] other parameters in script. make sure that's correct. , should check errors mysql_query(); if returns false, print mysql_error() see reason.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -