I need advice on how to do the mysql portion of a chatterbox script. It's similar to the one here but it's an anonymous script (the user types in their username and password each time).

Can someone tell me how THEY would setup the mysql part of this? Like what tables, columns, how you'd do it?

Details:

Admin Panel > *Admin usernames and passwords needed for login *Reserved name list (people can't use the names like "admin" in the + script *Swear words the admins wish to check for in a list *Blocked IP addresses for innappropriate users (will be checked eac +h time the script is loaded to see if they can use the chat script) Chat > *Stores their username, IP, date/time of message, message *Will print the last 5 or 10 messages stored Log > *Will display all messages in newest>oldest order with 50 messages +per page
I know enough how to do the usernames and passwords but I'm not sure if I should make a column for blocked IPs and each IP has their own row (same thing with the swear words to watch for and reserved names).

I was thinking it would be three tables. ADMIN (login information), CHAT (messages, ip, username, etc) NITTYGRITTY (blocked IPs, swear words, reserved usernames that users can't use, etc).

If it makes any difference, when the admin logs in it'll store their information in a COOKIE which the script checks. If this cookie exists they can use the RESERVED NAMES. No one else can use the names.

Before I go out and about and do this, if any of you has a better form to create this please let me know.


In reply to Chat script + mysql by coldfingertips

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.