User Profile

Collapse

Profile Sidebar

Collapse
cheesecaker
cheesecaker
Last Activity: Oct 11 '08, 07:34 PM
Joined: Feb 4 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • cheesecaker
    replied to Storing list data in MySQL
    So if the User and UserRelation tables were implemented in an actual application, in order to display John's buddylist, you'd have to do the following:

    Code:
    SELECT UserID FROM `User` WHERE UserName = 'John'
    And we'd get 1. Then we'd do...
    Code:
    SELECT FriendID FROM `UserRelation` WHERE UserID = 1
    And we'd get 2 and 3. Then we'd do...
    Code:
    SELECT UserName FROM `UserRelation` WHERE UserID = 2
    SELECT UserName FROM `UserRelation`
    ...
    See more | Go to post

    Leave a comment:


  • cheesecaker
    replied to Storing list data in MySQL
    I'm not familiar with the syntax for creating a table which references foreign keys. Could you explain the use of two column names with Primary Key()? I've only seen Primary Key (x), not Primary Key (x, x).

    Thanks for the help....
    See more | Go to post

    Leave a comment:


  • cheesecaker
    replied to Storing list data in MySQL
    This is pretty much the setup I currently have, but I thought it was inefficient. So just for clarification, this is the best way to store a list-type data set? If I wanted to store, say, a list of items that the user owned, it'd be the same thing? A table with itemID/itemName and another with userID/itemOwned?

    One other thing. On that second table, what would the unique primary key be? Would I just have an arbitrary one such as entryID...
    See more | Go to post

    Leave a comment:


  • cheesecaker
    started a topic Storing list data in MySQL

    Storing list data in MySQL

    How would a set of related values be stored together in a MySQL db?

    For example, if I wanted to store a user's buddy list, then the way I can think of would be something like this:

    user | friend
    John | Jim
    John | Bob
    John | Amy
    Bob | Jim
    Bob | Amy

    So John's friendlist would include Jim, Bob, and Amy, and Bob's friendlist would include Jim and Amy. But it seems really...
    See more | Go to post

  • cheesecaker
    replied to Account sharing
    Anybody have an idea about this?
    See more | Go to post

    Leave a comment:


  • cheesecaker
    started a topic Account sharing

    Account sharing

    I have a site that uses simple HTTP authentication, and I have a major account sharing problem. I need each person to have his or her own account, but people just spread their accounts left and right.

    I know you can't do much with HTTP auth, but is there any way, for example, to check if multiple users are logged into a single username at once?

    Or is there some way to get the currently logged username on the client machine...
    See more | Go to post

  • cheesecaker
    replied to PHP English dictionary, API or extension
    in PHP
    Haha, no, not a thesaurus, a dictionary. And it needs to be in an API or some other form easily accessed by calls made in PHP. Everything I find within these guidelines is for Java or Perl or something.

    I mean I could achieve the same effect by scrubbing the dictionary.com page for a word with regex, but that's really messy....
    See more | Go to post

    Leave a comment:


  • cheesecaker
    started a topic PHP English dictionary, API or extension
    in PHP

    PHP English dictionary, API or extension

    I need a script or extension for PHP that would allow me to look up definitions for English words. I don't mean spell checking, I mean looking up definitions.

    A dictionary website that provides an API would also be fine.
    See more | Go to post

  • cheesecaker
    replied to Frameset title tricks
    No. Oh, it's XSS security, isn't it? Gah.
    See more | Go to post

    Leave a comment:


  • cheesecaker
    replied to Frameset title tricks
    [html]<script type="text/javascript">
    function changeTitle() {

    document.title = window.frames["main"].document.title ;

    }
    </script>
    </head>
    <frameset rows="100%,*" onload="changeT itle();" frameborder="NO " border="0">
    <frame name="main"...
    See more | Go to post

    Leave a comment:


  • cheesecaker
    replied to Frameset title tricks
    By the way, I stuck an alert("firing") ; in there and it showed up, so the function's being called, I guess the JS isn't right?
    See more | Go to post

    Leave a comment:


  • cheesecaker
    replied to Frameset title tricks
    Because of the circumstances of the system I've set up, the frameset will reload every time the framed page reloads. And I need to set the title from the frameset page, but when I do[html]<frameset onload="changeT itle()" ... >[/html], it doesn't seem to work.

    I basically need to set the page title, from the frameset page, as soon as or before the framed page loads. How would that be implemented? I'm really Javascript-dull,...
    See more | Go to post

    Leave a comment:


  • cheesecaker
    replied to Frameset title tricks
    I want to take the title from the framed page and set it as the browser window's title, to put it simply....
    See more | Go to post

    Leave a comment:


  • cheesecaker
    replied to Frameset title tricks
    Anyone have an idea about this?
    See more | Go to post

    Leave a comment:


  • cheesecaker
    started a topic Frameset title tricks

    Frameset title tricks

    If I have a frameset page with a frame in it, how would I use JS to get the title of the framed document and set it as the title of the parent frameset page?

    If that makes no sense, please ask for clarification.
    See more | Go to post

  • cheesecaker
    started a topic Prevent scientific notation
    in PHP

    Prevent scientific notation

    Let's say I want to echo ".00002". PHP likes to echo "2.0E-5" instead. How would I have it print .00002 instead?
    See more | Go to post

  • cheesecaker
    replied to Disable multiple .htaccess logins
    Anybody have an idea about this?
    See more | Go to post

    Leave a comment:


  • cheesecaker
    started a topic Disable multiple .htaccess logins

    Disable multiple .htaccess logins

    How does one disable one username logging in from multiple machines when using .htaccess authentication?
    See more | Go to post

  • cheesecaker
    replied to file_exists() question.
    in PHP
    Yeah, I tried glob, but it's very inefficient. So I used a looping readdir();

    Here's the function. Works for my circumstances, don't know about anyone else's:

    [PHP]/** Checks whether a file with the specified string in its name
    * exists in the specified directory.
    * Returns 1 if any matching file is found, 0 if not.
    */

    function file_exists_con taining ($directory, $string) {...
    See more | Go to post

    Leave a comment:


  • cheesecaker
    started a topic file_exists() question.
    in PHP

    file_exists() question.

    Hi, I need to check if a file with a certain string in its filename exists. How would I do that?
    See more | Go to post
No activity results to display
Show More
Working...