Jump to content

Search the Community

Showing results for tags 'php sql database mysql'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I am writing PHP code for a database that (for this particular file) will pull up a particular item within the database with the fields first name, last name, and prayer request. The idea is that you select the item and can edit either the first name, last name, or prayer request if there was a typo, misspelled word, etc. When I click the "Approve Prayer Request Button" literally nothing happens. I also have a column titled Reg_ID which specifies which row of data you want to select to edit the information. It does not pull information from the server either, even though it did at one point. I think it is a problem with my mySQL statements but I have tried numerous things and cannot get it to work. I am wanting everything to be done within this file. Any suggestions would be GREATLY appreciated. This file is named Approve Deny Prayer Request. <?php $DB_HOST = "XXXXXXXX"; $DB_NAME = "XXXXXXXX"; $DB_PASS = "XXXXXXXX"; $DB_USER = "XXXXXXXX"; $link = new mysqli($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME); if($link->connect_errno > 0) { die('Connection failed [' . $db->connect_error . ']'); } $query = "SELECT * FROM Request"; $result = mysqli_query($link,$query); //<----- Added link $row = mysqli_fetch_array($result); if(isset($_POST['add'])){ $id = mysqli_real_escape_string($link,$_POST['REG_ID']); $firstname = mysqli_real_escape_string($link,$_POST['first']); $lastname = mysqli_real_escape_string($link,$_POST['last']); $phone = mysqli_real_escape_string($link,$_POST['phone']); $query2=mysqli_query($link,"UPDATE Request SET Reg_F_Name='$firstname', Reg_L_Name='$lastname',Reg_Request='$phone' WHERE id='$Reg_ID'" ); if($query2){ header("Location: fbcaltusprayerorg.ipagemysql.com"); } } // brace if(isset($_POST['add'])) ?> <form action="" method="post"> <table> <input type="hidden" name="id" value="<? echo "$row[id]" ?>"> <tr> <td>First Name:</td> <td><input type="text" name="first" value="<? echo "$row[1]" ?>"></td> </tr> <tr> <td>Last Name:</td> <td><input type="text" name="last" value="<? echo "$row[2]" ?>"></td> </tr> <tr> <td>Prayer Request:</td> <td><input type="text" name="phone" value="<? echo "$row[5]" ?>"></td> </tr> </table> <input name="add" type="submit" id="add" value="Approve Prayer Request"> </form>
×
×
  • 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.