Jump to content

Search the Community

Showing results for tags 'updating'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 1 result

  1. Hi guys, Been a while since I posted on the forums (if at all). Have an issue that's been biting me for about two days. It's probably staring me in the face though. I can display data from MySQL with PHP on the page just fine. However, updating the database via a form is just not happening. The form just reverts to display the data that was manually entered into the database or the database table is emptied upon submit. Here is the PHP being used to retrieve and update: // Update Database Tables $result = mysql_query("UPDATE `dev_cms`.`settings` SET `site_name` = '$site_name', `site_slogan` = '$site_slogan', `admin_email` = '$admin_email', `facebook` = '$facebook', `twitter` = '$twitter', `tos` = '$tos' WHERE `settings`.`id` =1;"); // Retrieve all the data from the "example" table $result = mysql_query("SELECT * FROM settings") or die(mysql_error()); // store the record of the settings table into $row $row = mysql_fetch_array( $result ); The form: <form action="settings.php" method="post"> <table class="listing form" cellpadding="0" cellspacing="0"> <tr> <th class="full" colspan="2">General Settings</th> </tr> <tr> <td width="172"><strong>Site Name</strong></td> <td><input type="text" name="site_name" class="text" value="<?php echo $row['site_name']; ?>"/> <i>Your website Name</i></td> </tr> <tr> <td><strong>Site Slogan</strong></td> <td><input type="text" name="site_slogan" class="text" value="<?php echo $row['site_slogan']; ?>"/> <i>A catchy slogan</i></td> </tr> <tr> <td><strong>Admin Email</strong></td> <td><input type="text" name="admin_email" class="text" value="<?php echo $row['admin_email']; ?>"/> <i>For outgoing email</i></td> </tr> <tr> <td><strong>Facebook Page</strong></td> <td><input type="text" name="facebook" class="text" value="<?php echo $row['facebook']; ?>"/> <i>Your Facebook address</i></td> </tr> <tr> <td><strong>Twitter ID</strong></td> <td><input type="text" name="twitter" class="text" value="<?php echo $row['twitter']; ?>"/> <i>Your Twitter ID</i></td> </tr> <tr> <td><strong>Terms of Service</strong></td> <td><textarea name="tos" border="0" cols="45" rows="5"><?php echo $row['tos']; ?> </textarea><i>Terms and Conditions</i></td> </tr> <tr> <td> <label> <input type="submit" name="Submit" value="Save" /> </label></td> </tr> </table> </form> If anyone could please, without too much Jargon, have a look and point me in the right direction I would greatly appreciate it. Thanks in advance.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.