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

Link to comment
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.

Link to comment
Share on other sites

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);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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