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
https://forums.phpfreaks.com/topic/56980-solved-update-problem/
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
https://forums.phpfreaks.com/topic/56980-solved-update-problem/#findComment-281463
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
https://forums.phpfreaks.com/topic/56980-solved-update-problem/#findComment-281470
Share on other sites

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.