• 29-07-2017, 12:42:33
    #1
    Merhaba,

    Scriptimin herşeyi sorunsuz çalışıyor(MySQL bağlantısı vs.) fakat form ile mysql verilerini güncellemeye çalıştığımda veriler güncellenmiyor. Fakat linkin sonunda "settings.php?status=ok" ibaresi çıkıyor ve form butonuna tıklanınca ekranda çıkması için herhangi bir yazı yazdığımda buton sorunsuz çalışıyor ve sorguyu bana gösteriyor. Butona tıkladığımda form elemanlarına girilen veriyi nasıl mysqldaki veri ile değiştirmesini sağlayabilirim.

    Form dosyam;

    <?php include 'header.php'; ?>
    
    <?php include 'sidebar.php'; ?>
    
    <!-- Index -->
            <div id="page-wrapper">
                <div id="page-inner">
                    <div class="row">
                        <div class="col-md-12">
                            <h1 class="page-head-line">Welcome to Settings</h1>
                            <h1 class="page-subhead-line">You can use here to change your website settings </h1>
                        </div>
                    </div>
                    <!-- /. ROW -->
                    <div class="col-md-12 col-sm-12 col-xs-12">
                       <div class="panel panel-info">
                                <div class="panel-heading">
                                   Settings
                                </div>
                                <div class="panel-body">
                                    <form action="inc/settings.php" method="post">
                                                <div class="form-group col-md-6">
                                                    <label>Site Title</label>
                                                    <input class="form-control" type="text" name="settings_title" value="<?php echo $getsettings['settings_title'] ?>">
                                                </div>
                                                <div class="form-group col-md-6">
                                                    <label>Site Description</label>
                                                    <input class="form-control" type="text" name="settings_descriptions" value="<?php echo $getsettings['settings_descriptions'] ?>">
                                                </div>
                                                <div class="form-group col-md-6">
                                                    <label>Site Keyword</label>
                                                    <input class="form-control" type="text" name="settings_keywords" value="<?php echo $getsettings['settings_keywords'] ?>">
                                                </div>
                                                <div class="form-group col-md-6">
                                                    <label>Site Footer</label>
                                                    <input class="form-control" type="text" name="settings_footer" value="<?php echo $getsettings['settings_footer'] ?>">
                                                </div>
                                                <div class="form-group col-md-6">
                                                    <label>Homepage Big Label</label>
                                                    <input class="form-control" type="text" name="settings_name" value="<?php echo $getsettings['settings_name'] ?>">
                                                </div>
                                                <div class="form-group col-md-6">
                                                    <label>Homepage Motto</label>
                                                    <input class="form-control" type="text" name="settings_slogan" value="<?php echo $getsettings['settings_slogan'] ?>">
                                                </div>
                                                <div class="form-group col-md-6">
                                                    <label>Facebook</label>
                                                    <input class="form-control" type="text" name="settings_facebook" value="<?php echo $getsettings['settings_facebook'] ?>">
                                                </div>
                                                <div class="form-group col-md-6">
                                                    <label>Twitter</label>
                                                    <input class="form-control" type="text" name="settings_twitter" value="<?php echo $getsettings['settings_twitter'] ?>">
                                                </div>
                                                <div class="form-group col-md-6">
                                                    <label>Google</label>
                                                    <input class="form-control" type="text" name="settings_google" value="<?php echo $getsettings['settings_google'] ?>">
                                                </div>
    
                                                <div class="form-group col-md-6">
                                                    <label>Is everything OK?</label><br>
                                                    <input style="width:100%" class="btn btn-success" type="submit" name="updatesettings" value="Save Settings">
                                                </div>
                                            </form>
                                    </div>
                                </div>
                              </div>
    
    
    
                </div>
                <!-- /. PAGE INNER  -->
            </div>
            <!-- /. PAGE WRAPPER  -->
        </div>
    
    <?php include 'footer.php'; ?>
    Formu karşılayan dosya;

    <?php
    include 'connect.php';
    
    
    
    if(isset($_POST['updatesettings'])) {
    
      $id=0;
    
      $updatesettings=mysql_query("update updatesettings set settings_title='".$_POST['settings_title']."' where settings_id='0'");
    
    
      if(mysql_affected_rows())
    
    
        {
          header("Location:../settings.php?status=ok");
        }
    
      else {
    
        header("Location:../settings.php?status=fail");
    
      }
    
    
    }
    
    
    
    
    
    ?>
    MySQL bağlantısı sorunsuz çalışıyor
  • 29-07-2017, 17:44:37
    #2
    Sorun Çözüldü. Virgül fazlalığından kaynaklı bir sorunmuş