Jump to content

[SOLVED] UPDATE problem


almightyegg

Recommended Posts

<?
include 'db.php';

$update = "UPDATE topics SET fid = 'gdis' WHERE pinned='No'";

$up = mysql_query($update) or die(mysql_error());

if(!$up){
echo "WHYYYY!!!?!?!?!";
}else{
echo "Woop!";
}

?>

 

It echoes out Woop! therefore meaning it's worked, but looking in my PHPmyAdmin table it hasn't changed. I can't edit it in PHPmyAdmin because it is currently getting errors when deleting/updating/creating things.

 

So what's wrong with the script???  ???

Link to comment
Share on other sites

Make sure this line is correct:

 

$update = "UPDATE topics SET fid = 'gdis' WHERE pinned='No'";

 

Make sure you are updating the correct table and you are looking in your MySQL for the correct table.

You may have intended to write this:

 

$update = "UPDATE some_other_table SET fid = 'gdis' WHERE pinned='No'";

 

Or you're looking in the wrong table in the PhpMyAdmin.

 

Sorry, cant see anything wrong with that code.  ???

Link to comment
Share on other sites

I believe it is an error with PhpMyAdmin now. I went back and tried editting them again with phpmyadmin and this time it let me, when I went back to make sure I'd imputted them correctly, they were still the same as before....it's just not updating information

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.