Fun with PHP/MySQL

I’m probably way more proud of this than I should be, but look what I just made!

True, it’s no g-blog.net – but it is technically my first database driven website that hasn’t relied on pre-written packages.

I mentioned a project I was going to use to get started writing database-driven sites a LONG time back. This isn’t it, but I’m now one step closer to finishing that.

goes back to futzing with his lame joke database…

(Hey Gossip, how about a “Coding/PHP” category? It could replace “Computers/Programming” which is redundant with “Coding”. Yeah, I know I’m the one that asked for “Computers/Programming” originally – but I didn’t see “Coding” for some dumb reason.)

Edited on Nov 22nd 2002, 17:53 by Hooloovoo

Published by

Robert

Robert Belknap has been writing online sporadically since 2001. See the colophon for more details.

10 thoughts on “Fun with PHP/MySQL”

  1. I guess I should explain what’s going on with that page… I have a database table called “Jokes” (although, I may change it to “BadJokes”.)

    jokes.php connects to the database, and prints out all the jokes in the table – some are 2 part Joke/Punchline – some are 1 part Joke. Right now all the jokes have to be entered into the database directly. The next step is to add a form that allows site vistors to add thier own bad jokes to the database. Other things I may do are add a “random joke” lookup and a display/search by joke type, (Knock Knock, Chicken, Lightbulb, etc.) That second one will require changes to the table structure – but shouldn’t be too hard.

  2. Its more an exercise than anything else – I found a basic online tutorial, looked at the example and said “hey I can do that, and I can add this and this and this too…”

    I also spoke with a friend about my (well our – it’s her database and will be my code) other PHP project. The main thing I need to get that one started is the data. Should be emailed to me today, I hope. Which means I can get stared on it over the weekend.

    Anyone know how to convert an Access Database to MySQL? I’m hoping the data gets delivered as a CSV ASCII file, but if it isn’t I was wondering if there was an easy way to do the conversion.

    Edited on Nov 22nd 2002, 18:42 by Hooloovoo

  3. @6 in theory yes, and that’s what I’ve asked for – but wether or not that is acually what I get is another issue. Oh, and do you mind if I scour the code for glue to get ideas on how to deal with formatting user input?

    @7 I saw your joke. Pretty bad – it’s been added.

    should write an admin page so he doesn’t have to keep typing that sql query to approve jokes.

  4. Access to MySQL: yes, do it via CSV. Unless it’s a stupidly large database and you have access to SQL Server, in which case use DTS to do the donkey work. The latest version of phpMyAdmin has a nice interface to LOAD which I used to bring a 1000 record Access database into MySQL in a few minutes.

    Nice work Hool. The code. Not the jokes. That’s bad work 😉

  5. okay – CSV it is… I’m still waiting on the delivery of that data so I can start working on that project. In the meantime, I’ll continue futzing around with my bad joke page – and trying to convert peeps to Jabber.

Leave a Reply

Your email address will not be published. Required fields are marked *