Jump to content

optikalefx

Members
  • Posts

    363
  • Joined

  • Last visited

    Never

About optikalefx

  • Birthday 04/23/1988

Contact Methods

  • Website URL
    http://www.square-bracket.com

Profile Information

  • Gender
    Male

optikalefx's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. I know this won't be possible with DOC, but it should be with DOCX. Basically I want to have someone write up a docx file using special tokens in certain places. Then my PHP would find and replace those tokens when the users needs to. It would create and serve a NEW docx file with the tokens replaced. Any ideas on this? I'm reading up on a ton of libraries, but nearly all of them, their examples don't work out of the box. Thanks!
  2. Your stealing a game thats meant to run within the walls of facebook.
  3. sure np. A little extra tip. For yes or no type storage, you should really use TINYINT(1) and store 1 or 0 instad of yes or no. Your database will be smaller and all your code will be simpler. Instead of checking WHERE blah ='yes' you will be able to just do WHERE blah. and if you want to display yes or no, you can do that with SELECT IF(blah,'yes','no') as blah
  4. Seriously - just calculate the end date and store that. There is an awesome mysql date function called DATE_DIFF that you can use in all your selects to return the duration without ever going to PHP. If you REALLY wanna store duration, you need to store a concatted string. 1:Y would be 1 Year. and you can use Y from the php date functions. So in PHP you would explode(":","1:y") to get that as an array. Or just store 2 fields. Either way you should just store the end date.
  5. Couldn't you use IF as well? $q1 = "UPDATE Events SET HPselected = IF(ID IN ( '{$eID}', '{$eID2}', '{$eID3}'), 'yes' , 'no')";
  6. replace would replace all of them. Which should be fine for your case. Paste the code you couldn't get to work.
  7. Again don't store the duration. calculate the end date in PHP and store that. The logic is much more refined that way.
  8. Thanks! that gave me the list. Now I think I can write a script to use this data to determine if a duplicate should be delete or not, and then i can finally unique the table. woot!
  9. SELECT Sales.*, otherTable.USQuantity, otherTable.USDollars, otherTable.MXQuantity, otherTable.MXDollars FROM Sales LEFT JOIN otherTable ON (Sales.Product = otherTable.Product) basically your using the Product field on both tables to JOIN those 2 tables together. Left join means i dont care if the join results in null values, just give me the row no matter what. JOIN alone (without the left) would do the same but not give you the row if the key did not exist on the other table.
  10. you don't have a database named "examples". double check all your spelling.
  11. Store the start and end date. If you want to adjust the duration, just adjust the end date. Because in reality that is what changing the duration means, it means its going to end later, or end sooner. Again using date_sub to figure out the actual duration if you want to know that specific information.
  12. Knowing the primary keys of each row you want to update - you can use REPLACE to do multiple Updates just like you would use INSERT to do multile inserts. REPLACE INTO table (primaryKeyColumn, col2, col3) VALUES ('primaryKeyValue','val2','val3')
  13. Well a primary key already exists, this is another field. Basically the user_id is the primary unique key. But there are duplicate usernames. and right now people have duplicate usernames. I want to somehow purge all duplicates.
  14. Ok, can you explain why that worked? I put an index on userpermissions.UserID and now it works. So... why?
  15. if you were 100% that it will never be a many to 1 relationship than an 'answer' is just a property of a question. Therefore it can just be a field on the question table. But you also have to ask, will there ever be information about an answer that isn't directly about the question? Like, how long it took to answer that question, what order the answer appeared in, etc.. That all could still be on the question table, but you wanna make sure that an answer is just 1 piece of info about a question and it isn't an entity of its own.
×
×
  • 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.