Jump to content

Mirkules

Members
  • Posts

    44
  • Joined

  • Last visited

    Never

Contact Methods

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

Profile Information

  • Gender
    Not Telling

Mirkules's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. One quick note, some hosts do not support the mail function -- you might have to authenticate a user before sending emails. It's best to look at your host's documentation to find out the appropriate method for sending outgoing mail.
  2. Hi All, Does anyone know a release date for MySQL 5.1? In particular, I am interested in the TRIGGER privilege, which allows non-superuser accounts to be able to add/modify/delete triggers. A hosting company I am working with is (understandably) refusing to upgrade to a RC version (despite it being in development for 2 years already). What's worse, in order for them to add triggers in my name, they want to charge me $120/hr (without having given me an estimate on how long it will take) even though I have provided them with my trigger code, while at the same time saying that trigger privileges are not a requirement of MySQL 5.0. So, in order for me to twist my host's arm, MySQL 5.1 needs to be a stable release. So, barring any new changes to the MySQL stable branch (and soon!), I will not be able to use triggers with MySQL. Maybe I'll have more luck with PostgreSQL? Anyone have any experience with triggers in PostgreSQL? What is it like migrating from MySQL to PostgreSQL (assuming I wrote my code with PDO or PEAR::MDB2, which, sadly, I didn't lol) ? Are there many hosts that support PostgreSQL? Also, I'm curious if anyone heard anything about PHP 6's release date? PHP 6 was discussed here http://www.phpfreaks.com/forums/index.php/topic,169200.0.html but there was no definitive answer. Anyway, thanks, and goodnight.
  3. People who expect you to do their work for them. Question: I'm having this problem, what am I doing wrong? Answer: There's your problem, here's how to solve it. Question: I'm still not getting it, can you look at my 3 million pages of code and figure it out? Answer: ...
  4. I don't think there is a way to maintain state of the objects. HTTP Requests by definition are stateless. On second thought, I wonder if it would be possible to serialize your object into a cookie But that would raise all sorts of problems, like security issues, what happens if the client doesn't have cookies enabled, etc... Out of curiosity, what were your previous attempts at this?
  5. You need to add: toggleBox('<?=$comma_separated?>',1); Basically, you want the PHP interpreter to, ahem, interpret your variable. Another way to do this is (the above is just shorthand): toggleBox('<?php echo $comma_separated; ?>',1);
  6. Mirkules

    preg_match

    <?php $string = "hi "; if(preg_match('/:\)/', $string)) { echo "Found Smiley"; } else { echo "Smiley not Found"; } ?> http://us2.php.net/preg_match
  7. You can also use file headers to verify the image: http://www.mikekunz.com/image_file_header.html
  8. I used to work for a large company that had four numbers in the version, i.e. 10.1.2.3. The first number is a major release, the number after that is a minor release, maintenance release, and testing release. Major release is when there is a significant restructure of the core of the components in a system. Minor changes several components. Maintenance fixes bugs in components. Etc... A good way to think of a major release is when a company makes a completely new product, new packaging, etc. For instance, Windows XP is a major release, SP1, 2, and 3 are minor releases, patches are maintenance releases, and, I believe, testing releases are RC's. These numbers are also used to identify how much regression testing should be done. For example, in a major release, generally the entire system is tested end-to-end. In a maintenance release, only that module is tested. In fact, sometimes these version numbers are used to bypass a part of testing to save time (tsk tsk) in order to meet deadlines. Back to the point, versioning can be completely subjective, and for our purposes two numbers is plenty. Generally, something becomes 1.0 once it works as requested in the requirements documents. Any FIXES after that go under 1.x (and there can be more than 10, i.e. 1.10, 1.11 1.20 is not unusual). A collection of new features or a major new feature warrants a new Major Release.
  9. Let me know if you get stuck. Also, read this link for reference: http://www.databasejournal.com/sqletc/article.php/26861_1474411_1 It talks about all the stuff I explained earlier, but much more eloquently. Good Luck!
  10. Yes, the way you do that is with yet another table. Suppose we originally have a USER table, PROJECTS table, and a new table called USER_PROJ_REL table. The USER_PROJ_REL table will tell us which users belong to which projects by assigning a project ID from the PROJECT table along with a user ID from the USERS table into a new row. So, each project has a unique ID (unique relative to the PROJECT table), each USER has a unique ID, and the USER_PROJ_REL will contain a relation between the two: USERS user_id (primary key) ... PROJECTS project_id (primary key) admin content USER_PROJ_REL user_id (foreign key to USERS table) project_id (foreign key to PROJECTS table) Suppose you have users with IDs 1,2,3 belonging to a project with ID 999. The USERS_PROJ_REL table would look like this: USER_ID, PROJECT_ID 1 999 2 999 3 999 So you query would then look like this: SELECT projects.*, users.* FROM users, projects, user_proj_rel WHERE admin='1' AND content='1' AND projects.project_id = users_proj_rel.project_id AND users.user_id = user_proj_rel.user_id AND projects.project_id='999'; This will give you a list of all users belonging to project 999.
  11. There are two problems with the query that you showed. I'll start with the easier issue. Whenever you have AND and OR operations, the OR operations should ALWAYS be surrounded by parentheses () because of precedence. So, in your query, I would do something like this: SELECT * FROM projects WHERE current = '1' AND admin = '1' AND (user1=$user_id OR user2=$user_id OR user3=$user_id OR user4=$user_id OR user5=$user_id OR user6=$user_id OR user7=$user_id OR user8=$user_id OR user9=$user_id OR user10=$user_id OR user11=$user_id OR user12=$user_id OR user13=$user_id OR user14=$user_id OR user15=$user_id OR user16=$user_id OR user17=$user_id OR user18=$user_id OR user19=$user_id OR user20=$user_id) If you omit the parens, the ADMIN='1' AND user1=$user_id would get evaluated first, and I'm pretty sure that's not what you want. Remember, AND always takes precedence over OR. The second problem is a design issue. I'm not really sure why you have user1, user2, user3 columns. If you have multiple users, what you should really have is a separate table that holds all the user IDs, like this: USERS user_id (primary key) name ... and in your PROJECTS table, have an foreign ID column that references the USERS user_id column, like this: PROJECTS current admin user_id (foreign key to USERS) Then you query would look like this: SELECT * FROM projects, users WHERE current='1' AND admin='1' and projects.user_id=users.user_id; Hope this helps.
  12. Hi All, I have a form that is being submitted to a "middle layer" php script which is then supposed to redirect (along with the POST variables) to a secure site. The prevalent method of doing this is through the fsockopen() method writing the header information directly. However, since I am redirecting to a 3rd party secure site, I am wondering if this method is secure. It just doesn't seem very elegant, especially since the URL doesn't change to HTTPS. Here is the code for the fsockopen() method: http://www.faqts.com/knowledge_base/view.phtml/aid/12039/fid/51 Thanks in advance, Mirkules
  13. btherl, thank you for the scaling. Even though it's not directly what I was asking for in this post, I would have had to tackle that problem eventually. The problem I'm having is that I cannot connect the dots. If you look at the images I attached, you will see the original smiley face, the version of the smiley translated into polar with my script and a version done with Photoshop's Filter->Distort->Polar Coordinates. What I'm really trying to achieve is continuity, just like PS. Any deas how PS may be doing that? [attachment deleted by admin]
  14. Yeah, I understand that I need to convert the X coordinate and Y coordinate so that they are between the xMin/xMax and yMin/yMax bounds. What I don't think I understand is what is the function to get a point like x=1.5674243 between the xMin and xMax?
  15. I'm afraid you can't randomly select a number an use it to reference the array, if the array is associative. What you would have to do is pick a random number and then loop through the array that many times until you reach the desired key. For example: $random = rand(0, count($myClass)-1); //picks a number between 0 and the number of elements in your array $selected_key = ""; for ($i = 0; $i < $random; $i++) next($myClass); //the array pointer is pointing at the selected value $key = key($myClass); $value = current($myClass);
×
×
  • 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.