Annoying Poll
Moderator: General Moderators
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
-
jollyjumper
- Forum Contributor
- Posts: 107
- Joined: Sat Jan 25, 2003 11:03 am
It's easy:magicrobotmonkey wrote:Yea i missed that the first time around - doh! I'm working on figuring out how to restore from bin-log now. I only need the day so im going to convert to DATE and then just make it now() on insert.
- restore your database from backup
- then use mysqlbinlog utility to convert the binlogs to SQL queries (save its output to file)
- remove that update query from the file
- feed the file to mysql utility:
Code: Select all
cat filename.sql | mysql -u username -p -h hostname
WS_FTP Pro re-sends the file on reconnect ^_^.Bill H wrote:Or this one always cracks me up when I do it.And so on until I realize I was moving the wrong file to the server.
After repeated uploads and tests WS_FTP times out and disconnects. No, I don't fail to notice that and reconnect. I reconnect and fail to upload the modified file! Then I can't figure out why my change didn't work. Seems I somehow think that merely reconnecting is all I need to do!
- evilmonkey
- Forum Regular
- Posts: 823
- Joined: Sun Oct 06, 2002 1:24 pm
- Location: Toronto, Canada
Personally, I vote for 500 errors. They are so damn hard to correct it's not even funny. I speak as a person who spent hours trying to troubleshoot that piece of sh8t error to no avail, until something finally came through for me. 500 Is the most annoying and uninformative error in computer programming.
-
impatientone
- Forum Newbie
- Posts: 1
- Joined: Wed Jun 30, 2004 5:56 pm
Hrm...
We had just finished a year long contract that was huge and difficult but was finally working, tested and stable. The same day we launched it I had 2 simple tasks... upgrade the php install and catch a flight to the balkans for the summer so I could go on vacation.
I get to the hostel, I am a few (a dozen or more) beers in and I decide to check my webmail..
Somehow I had disabled the
and now the clients site was spitting back all of my code..
Ugh, thank god our sysadmin is a god. He so saved my ass.. the last thing I wanted was the check that I was travelling off of to be the last one I got from the company I work for.. Would have wrecked a damned good vacation.
?>
I get to the hostel, I am a few (a dozen or more) beers in and I decide to check my webmail..
Somehow I had disabled the
Code: Select all
<? short tagsUgh, thank god our sysadmin is a god. He so saved my ass.. the last thing I wanted was the check that I was travelling off of to be the last one I got from the company I work for.. Would have wrecked a damned good vacation.
?>
Most Stupid Mistake Ever
A friend of mine, relatively new to programming, once spent the best part of a fortnight trying to write a complex (for him) if() statement that would execute when the result of part of the comparison evaluated to null
After much deliberation he consulted me..
I pointed out the NOT keyword
....
He dropped the project and never went back to it
After much deliberation he consulted me..
I pointed out the NOT keyword
....
He dropped the project and never went back to it
missing ';'
i think spending 2 hours debugging a script to know in the end that a ';' is missing , is a good purpese to suicide 
- Skittlewidth
- Forum Contributor
- Posts: 389
- Joined: Wed Nov 06, 2002 9:18 am
- Location: Kent, UK
- Heavy
- Forum Contributor
- Posts: 478
- Joined: Sun Sep 22, 2002 7:36 am
- Location: Viksjöfors, Hälsingland, Sweden
- Contact:
I would like to say I have a pretty solution to that problem.McGruff wrote:The worst are the ones which spit out a line number far removed from the source of the problem.
First of all: DONT have SHOW_BACKTRACE_ON_ERROR == true except during development. If an error occurs, debug_backtrace() does not hide anything that should be secret...
This error message function, shout(), can echo, email, and backtrace your errors. Very useful.
Code: Select all
<?php
function backtraceTable($arrBackTraces){
//Alright... This one is not pretty,
//but I was in coding mode="general,portable" that day...
$strTable = "<table style="font-family:Tahoma" border="1">\n<tr style="font-weight:bold"><td>" .
join("</td><td>" , array_keys($arrBackTraces[0])) . "</td></tr>\n";
foreach ($arrBackTraces as $arrBackTrace){
$strArguments = '';
$argCount = 0;
foreach ($arrBackTrace['args'] as $arg){
$strArguments .= "<b>" . ++$argCount . "</b> " . $arg . "<br>\n";
}
$arrBackTrace['args'] = $strArguments;
$strTable .= "<tr><td>" . join("</td><td>" , $arrBackTrace) . "</td></tr>\n";
}
$strTable .= "</table>";
return $strTable;
}
function shout($strError){
if (constant('SHOW_BACKTRACE_ON_ERROR')){
$strError .= backtraceTable(debug_backtrace());
}
if (constant('ECHO_ERR_MESSAGES')) {
echo "<pre style="color:red">" . $strError . "</pre>";
}
$strError = "[{$_SERVER['REMOTE_ADDR']} - {$_SERVER['REMOTE_HOST']}]: $strError";
$strTime = time() . " - " . strftime("%a %d %b %y %H:%M:%S %Z") . " - " . basename($_SERVER['SCRIPT_NAME']) . " -- ";
if (constant('MAIL_ERR_MESSAGES')) {
mail( constant('EMAIL_ADMIN'),
'Error at: ' . $_SERVER['HTTP_HOST'],
"$strTime\n$strError\n",
(strlen(constant('EMAIL_SENDER')) ? "From: " . constant('EMAIL_SENDER') : null)
);
}
if (constant('LOG_ERR_MESSAGES')) {
$strBail = "Cannot open logfile for appending complaint ( " . constant('LOG_ERR_MESSAGES_LOGFILE') . " )";
clearstatcache();
if (!$handle = fopen(constant('LOG_ERR_MESSAGES_LOGFILE'), 'a')) {
echo "fopen(): " . $strBail;
exit;
}
if (fwrite($handle, "$strTime$strError\n") === FALSE) {
echo "fwrite(): " . $strBail;
exit;
}
fclose($handle);
}
return FALSE;
}
?>I was at home... as root... Thought I was somewhere else, namely in a cache folder for my template engine... then I issued:
Code: Select all
rm -rf *CTRL+C!
Then I actually saw nothing important was missing.
I have no idea about where the recursion started working, but everything works as usual. It must have been running off an old manual folder with several thousands of files laying around, because everything important to me seems to be where it should be.
Conclusion:
1 Never do that.
2 Always keep your home directory really really really really bloated...
For me it would have to be the infinate loop. I think I inadvertantly nuked my host's server on three separate occasions before the host finally modified their server to time out after my script has been running a loop for 5 seconds. I'm lucky I have such a patient host that didn't just revoke my account. 
In terms of unreversable errors, I'd have to say it's updating or deleting the mysql query without a where clause. It only happened to me once, but that is a mistake I'll remember never to make again.
In terms of head-banging typos that leave you pulling your hair out until you realize it's just a misplaced (or missing) character, the award would have to go to the missing } somewhere. Fortunately, I use a PHP editor that makes it easier to find where it is, but it still takes some brain work. To make matters worse, I rarely tab my control structures.
In terms of unreversable errors, I'd have to say it's updating or deleting the mysql query without a where clause. It only happened to me once, but that is a mistake I'll remember never to make again.
In terms of head-banging typos that leave you pulling your hair out until you realize it's just a misplaced (or missing) character, the award would have to go to the missing } somewhere. Fortunately, I use a PHP editor that makes it easier to find where it is, but it still takes some brain work. To make matters worse, I rarely tab my control structures.