Jump to content

birbal

Members
  • Posts

    2,543
  • Joined

  • Last visited

Posts posted by birbal

  1. I am not sure but probably it will have validation error if you put table tag inside form tag. The second option will be better.

     

    and more important is "MOVE EVERY DATA FROM A DATABASE TABLE TO ANOTHER AND DELETE IT WITH A SINGLE SUBMIT". can u please help me with this...???

     

    You can use INSERT INTO tablename SELECT * FROM tabletwo (check the manual of mysql) variation to select all column from table and insert it into another. and then use DELETE query to delete it from the first table. you can also use transaction to make it synced.

  2. Do you use ORM in your production or commercial application? I think ORMs are good for maintaining OO relation with datbase, But it has its limitation. For DML ORM is great for faster development and minimize duplication of code. But for DQL I think it is hard to do complex SQLs with ORM. Raw SQL would go along well.

    I have read somewhere it is not good to fit something like RDBMS to OO which it is not. Anyway i dont know how many open source and commercial application uses it. It looks like OSCommerce prefer to not use ORM.

     

    I have own written active record like ORM which uses Reflection to map the classess. It works well with DML and DQL (one to one,one to many relations). But have some issues with many to many relations (It could be resolved though i think). Though it serving well , I am not much happy with it as i expected. I can even see if i use Raw SQL i could even mnimize (for DQL) one or two query than that ORM. Though that helps to reduce writing code manually a lot.

     

    Conclussion, I have decided to use it in DML part. and change the DQL part to be raw SQL specially in many to many relations table and complex queries.

     

    From this disappointment i look into other ORM like doctrine or propel. But they have learning curve and fairly complex. They I think do lot of things than i need. Currently I am not in position to invest time to read and grasp whole doctrine/propel and at the end , find the same conclussion as above. I know benfits and drawbacks of ORM, still hearing any experience regarding this would helpful. Another query does Doctrine supports temporary tables or not ?

     

    Even I tried to install doctrine. But composer showing some error. Before i resolved it and invest time. i would like to hear your story with ORM.

    • Like 1
  3. when you use concatenate operator it tries to take out return value. include_*() or require_*() returns 1 on success and false on failure. Where as including the files does execute the file and if it prints anything it gets written on buffer directly. so it prints the data out of flow. so you get printed 1 in place where you try to echo include() and the outputed data prints elsewhere.

  4. If you need to decrypt the text then the server needs the key, so your options are to have the user store the keys and supply them for decryption, or have the server store them either directly or in a way that they can be calculated. Why not just store the key directly in the database? What is the nature of the text that you're trying to encrypt?

    If user specifies the key explicitly i could decrypt it ithout storing the key anywhere. For other case i think i need to do either of the way storing it or calculating it.

     

    Does not storing the key in same machine even worse in same database looses the purpose of the key? I think calculating it will be better than storing it in database.

    What is the nature of the text that you're trying to encrypt?

     

    what do you mean?

  5. @justsomeguy yes but there will be many entries of text and i dont want user to remember that many keys. There should be a default one per user basis. And optional another way to pass key by user which will work as usual .yes i need to save it and also need to decrypt it.

  6. Dot is concatenatio operator in php unlike js where it is used to access objecj property and method|Array convert into string when you conacatenat and prints 'array' and 'length' tries to find constant of same name if its not there it assumes string and convert to it. Though it throw some error. You should set your php to show all type of error which are helpful for debugThere is count() to count array element

    • Like 1
  7. I want to encrypt some text. But problem is i dont want to pass key for each encryption. Also i want to make sure that system does not know the key. The texts will be created by authenticated user. Any idea how could it be accomplished? As far i can think to create key from hash of some user data and other data mixed together. But that does not sound much secure. As seeing the code it will be easy to get the key.

    There is option for pass key for each entry but i want to encrypt it anyway even user don't put key for the encryption text

  8. If it is why?

    It is good pracitice because it helps to property initialization when object creates. You can give only scalar values and arrays as default to properties, but not reference type like object.

    • Like 1
  9. In short, how does software license works? Do the software needed to be registered somewhere to copyright? How to claim ownership of closed source code?. I have heared of a site which does that, but can not remember the name. Tried google with no luck, may be anyone can remind me about it.

×
×
  • Create New...