Jump to content

drewjoh

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

About drewjoh

  • Birthday 09/18/1982

Contact Methods

  • Website URL
    http://www.yipmedia.com

Profile Information

  • Gender
    Male
  • Location
    Texas

drewjoh's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Figured it out, just had to use a JOIN and then sort by the field in the JOINed table.
  2. Hi guys, Is it possible (I imagine it surely is somehow) to sort by a field that is just referenced in a table? For example: I have the following tables: 'users' with the fields: user_id, group_id, name, username 'groups' with the fields: group_id, name Is there a way to form a query that will display all the users, but sorted by their group name alphabetically? I can obviously, easily sort by their group_id, but that doesn't benefit me much! (Hope I explained that well enough!)
  3. Thanks thorpe! So by changing the DNS Servers, would that mean changing them on the router? I currently use OpenDNS configured from my router, so I would have to use the local server as my DNS server rather than OpenDNS?
  4. Hi All, I'm wanting to create a local Ubuntu or CentOS server on my local network with virtualhosts, so I can use URLs like "testserver1" in my browsers and it accesses the local server box. (For web dev testing) I found I can do this by setting up the virtualhosts in Apache, and then on my other machines (Macs) I have to add that to the hosts file to have it use a specific IP address (local one). What I'm wanting is to just be able to define new hosts in Apache, and it be accessible across the local network without modification to each computer. I was able to do this easily with Windows Server 2000 about 3 years ago. I would just setup the server with a name, and typing that in the address bar in a browser accessed that local server. Can Apache not do something similar? (Yes, I've Googled lots!)
  5. Yeah, that's a good point. I imagine I'll solve that by creating a "master" user table, so when a new group/user is created, it's added to the admin database also (and changed when groups/users are changed), and then have that linked to the individual database, with a global mysql user that can access them all if needed (from a coding standpoint). Thanks for your input fenway!
  6. Yeah, I'd never need to pull them all together in the sense that we need all the records from all the tables merged with another database (or all the databases). I'd only need some information from all of them to be able to administrate all the accounts/groups.
  7. Anyone have any thoughts? After some more digging and thinking; I think I'll go with the multiple database route. I can see an added security benefit, faster searching for each group, and the ability to scale by putting different databases on different servers. The only thing I can think of that would be a problem is keeping up with it all. Perhaps have a master database to keep track of users, global stats, etc.
  8. I'm curious about how to plan for scaling and I'm looking for some thoughts, advice or comments about the concept. Say, for example, let's assume a web app like Basecamp with stats such as: - 10,000 users - 2,000 groups (accounts that multiple users can belong to, but they can only belong to one). - 4,500 projects (multiple projects per group, can only belong to one group) - 200,000 to-dos (belong to a project) - 20,000 milestones (similar to to-dos) Since different groups (and also projects, to-dos and milestones) will be accessed at varying levels (active groups vs. not very active groups vs. dead groups), I don't assume at all that it would be very efficient to put all this information in one database. Searching through to-dos or milestones could just be insane, or would indexing compensate for that? (would just searching the to-dos in a particular project effectively, instantly narrow the searching to those records only? What about memory consumption and inserting and deleting rows?) Or would it be better to have separate databases for each group? So only groups that are active are loaded or bothered with? Searching would effectively be quicker? Deletions and insertions would be faster? But I can see things like looking up users in a backend could be incredibly trying. How do you manager all the groups, users, etc from a single location? What about having to initiate connections with lots of different databases as opposed to just one? Is that so much more resource intensive? I guess I don't understand the technicalities of MySQL enough to understand how to figure these questions out. Should I be looking for a different solution altogether for such a scaling? From what I do understand, it seems like one large database would be the best solution assuming data amounts don't get out of hand. How much more of a strain does a 20GB database put on a server as opposed to lots of little 20MB ones?
  9. You could check the $_SERVER['HTTP_REFERER'], but this isn't 100% reliable. You could set a session variable on form.php, and check for it on process.php. If it's not there, then they didn't go to form.php first. That solution only works once though. Or, you could set a hidden variable to pass through, and check for that. <input type="hidden" name="valid_user" value="true" /> Or, you could check that all the fields have been set (or at the least the ones that have to), and if they're not... send them back to form.php. <?php if(!isset($_POST['name'])) header("Location: URL/form.php"); // They didn't enter their name or they came to process.php directly!
  10. What you're trying is not possible. PHP is executed at the server level, and Javascript is executed at the browser level. You could give text to the browser to execute the function if you'd like, for example: Replace <?php javfunc(); with <?php echo '<script type="javascript">javfunc();</script>'; This will output "<script type="javascript">javfunc();</script>" to the browser, and the browser will take that and execute the javascript "javafunc()".
  11. 100 shouldn't be a problem. If you were going upwards of maybe 5,000 or so, then I'd say it might be good to look for a better method (database). Do look at the note at the bottom of preg_match: http://us2.php.net/manual/en/function.preg-match.php If you can use strstr(), it is faster than preg_match.
  12. This will stop your loop: <?php break; More information here: http://us.php.net/break Just put that in the if( $Match[2] ) statement.
  13. Thanks for your reply JD2007! When I saw your post I was like "oh, duh!" and went to do that, but... "function" was there, I just didn't include it when typing it out here in the forum. So... no go, ??? I must be doing something wrong... or something. Especially if this works for you... then I don't know what to think! I tried it some more, and this is what happens with two examples: - The first example of the test string is when saying "echo $test->var" when the variable was set in the class definition. - The second example of the test string is when setting the $var after initiating an instance of the class, and then outputting it. In Firefox, when I view source (Firefox source browser), I get: Bi?r hj?rt Rol? 202 3? 1? - Bièr hjärt Roló 202 3º 1ª And in IE, when I view source (in notepad), I get: Bièr hjärt Roló 202 3º 1ª - Bièr hjärt Roló 202 3º 1ª Firefox displays in the browser just what you see in source. IE displays "Bi�r hj�rt Rol� 202 3� 1� - Bièr hjärt Roló 202 3º 1ª" in the browser. I still don't get it! An hour or so more of searching and googling hasn't provided anything new. But at least I've figured out my limitations...
  14. I think IE tries to match up the said filesize with the actual size of the content it's being given, and if it doesn't match: it fails. Whereas Firefox will just deal with it. Something to that effect... Seems like a good while ago I was doing something similar. Good luck with your presentation!
  15. Just a quick guess, but doesn't this line: <?php header("Content-Length: ".filesize(basename($filename))); ?> need to be: <?php header("Content-Length: ".filesize($filename)); ?> Seems like to get the filesize, you need to link to the file with the directory path, otherwise it's looking in your current working directory?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.