in reply to Re: Re: Re: Re: Re: Re: Re: Re: Re: Modifying Perl script to write to MySQL??
in thread Modifying Perl script to write to MySQL??

I've tried to modify the script as I thought you have suggested:

http://www.usedflutes.com/countzero.txt

Does that look like what you had in mind?
If so, can you please tell me what then becomes of the  $guestbookreal = "/home/flute/usedflutes-www/new_listings.html"; part of the script?

Thanks again CountZero for helping me out with this.

-Bob

p.s. Yes, I have downloaded the nms script and do intend at some point in the not-too-distant-future to update my script. I very much appreciate the encouragement from yourself, Dave and others to do so, thanks.
  • Comment on Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Modifying Perl script to write to MySQL??
  • Download Code

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Modifying Perl script to write to MySQL??
by CountZero (Bishop) on Feb 16, 2004 at 22:14 UTC
    You should put the while (<FILE>) { on a line by its own or else it will not be seen because of the comment prior in that line.

    As to what becomes of the $guestbookreal part of the script I have no idea whatsoever. For that I would have to analyze the whole script and sadly I'm lacking in time to do so.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      That worked! !

      There's a couple of strange anomolies:

      - Date field now says "Friday, February 13, 2004"
      - "dt_update," and "dt_create" fields show nothing but zeros

      anyhow, at least NOW the ads post to MySQL (yippie!)
      (whatever's causing those other bugs, that's a different chapter...)

      Many thanks for all your help CountZero! :-)

      -Bob
      >As to what becomes of the $guestbookreal part of the script I have no idea whatsoever.
      >For that I would have to analyze the whole script and sadly I'm lacking in time to do so.

      Unfortunately CountZero, I now know what the answer is! - it's what gets printed every time the script is run....
      I couldn't figure out why I kept getting the same result over and over no matter what I put in the form, and so I tried deleting that $guestbookreal=newlistings line and got a "500 Internal Server Error"

      Bingo!
      explains why the date was showing up as February 13 etc. - because that's the same INSERT string that's been on the new_listings.page since Friday - not what's going through the script!
      anyhow...

      still glad to have been shown that it's possible to connect to MySQL this way (even if it's still not working quite right yet)

      Many thanks CountZero, honestly :-)

      -Bob