Jump to content

Help updating database


Paws

Recommended Posts

<form method="post" action="adminprocess.php">
      <label>Board Name
      <input type="text" name="forumname" value="<?php echo $info_r['forum_name']; ?>">
      </label>
        <p>
          <label>Board Description
          <input type="text" name="forumdescription" value="<?php echo $info_r['forum_description']; ?>">
          </label>
        </p>
        <p>
          <input type="submit" name="Submit" value="Submit">
        </p>
    </form>

 

$forumname = $_GET['forumname'];
$forumdescription = $_GET['forumdescription'];

$query = "UPDATE `info` SET `forum_name` = '$forumname' AND `info`.`forum_description` = '$forumdescription'";

mysql_query($query);

 

I'm using that code to update my database but it isn't working :/ Can anyone help?

Link to comment
https://forums.phpfreaks.com/topic/168485-help-updating-database/
Share on other sites

^^ EXPLAIN TO HIM WHAT HE DID WRONG!

 

<form method="post"

 

Your form method is post, thus you must get the HTTP POST VARS using $_POST....instead you were using $_GET

 

Thanks, god I feel like an idiot now -.-

 

Don't worry lol, we all make mistakes, and thank Bricktop for fixing it for ya.

Before you do the mysq_query() output the query variable to see if it's what you expect it to be;

 

$forumname = $_POST['forumname'];
$forumdescription = $_POST['forumdescription'];

$query = "UPDATE `info` SET `forum_name` = '$forumname' AND `info`.`forum_description` = '$forumdescription'";

echo $query;

mysql_query($query);

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.