Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by birbal

  1. birbal

    error handling

    You need to look into "Transaction"
  2. If you want to made application for multiple device (visual look) you may like to look into "responsive design" instead of detecting the user agents.
  3. Before inserting the row does not exist. how do you plan to know its id range prior to insertion? what you want to do actually?
  4. bind_param should be either named parameter. where :user is place holder$stmt->bind_param(':user', $username); OR numeric place holder '?' . like...$stmt->bind_param(0, $username); or directly pass parameters to execute() $stmt->execute([$user,$password]);
  5. No, i did not mean to have common data in both table. I said to use foreign key which is used to avoid data duplication. I meant exactly what justsomeguy just elaborated.
  6. Use a table as base 'regular user' table and use another table for business user where there will be a foreign key pointing to regular user. If a use chooses to close his business identity just let them delete the data from business user table, whereas there will be still data for him as regular user in corresponding table. You should avoid duplicate data where possible and use reference instead.
  7. birbal

    Browser support

    i would like to know what is your minimum requirement of browser compatibility when you develop web app/site?
  8. D0M can parse remote file. If remote file access is disabled by your host you can use curl to fetch the page and use its content in DOM. Don is easier when you are handling html and xmlBe aware that different host has different scraping policy. Scraper should obey the robot.txt file (proper way of using). If their is an api for 3rd party site better use it. For resource abuse 3rd party site could block your ip
  9. As far i know you need to inbox any 'active' moderator for that and wait for them when they be online and get your job done
  10. birbal

    PDO error reporting

    There are three type of error mode in PDO silent (default),exception,traditional php error. silent will not show any error you need to use PDO::errorInfo() and PDO::errorCode(). traditional php error will show php warning and errors. and exception mode will throw exception which can be caught in between anywhere in call stack. to change the error mode attribute you need to use PDO::setAttribute()
  11. codewise they are very similiar if not exact same. Procedural style has most similarity. learning PDO is worthy. I personally use PDO even though most commonly RDBMS i use is mysql.
  12. I dont think you can get list of each and every aplication had made till now. Though you can get list of application by context. Like list of help desk,cms,forum etc. (like already posted) you have to go through them.
  13. keeping the files out of web root will be safest. Also you can use .htaccess to restrict access to files
  14. Have anyone has experience with any PHP based ORM? I would like to know how much complex query it can handle. I am using my own object mapper which uses reflection to get structure of object and make query dynamically but it is probably not full blown as Doctrine or Propel. I keep adding things when needs arises. Though it can handle basic CRUD operations maintaining object tree. but fails in some places like using Aggregate function on joined or simple tables or in non trivial case. in those case i need to write the query manually. Most of the baisc CRUD operations is operating as intenteded. Does Proffesional ORM handle non trivial queries or those are limited to basic opeartions?
  15. what do you suspect to be wrong here?
  16. birbal

    mysqli_query problem

    you should check if query is successfully executing or not. to do so you need to use mysqli_error() with mysql_query() too as mentioned by niche. If your query has external unescaped input, it could break the query.
  17. birbal

    PHP timezone

  18. birbal

    Storing avatars

    There have been previous discussion about these if you search the forum. Filesystem would be better. If you use database there would as many database calls as your image. because on each request you can only pull and display one image, Unless you are making a sprite of your avatars and using css to display it. In that case you will have one request but managing sprite would be complex than single image processing. Database calls are slower than filesystem access. Apart from that storing in database will be easier to backup image data along with other data.
  19. JQuery is like JS, works on clientside. mixing with php wont work. can you tell what are you trying to accomplish actually?
  20. birbal

    If else statement

    you can use http://php.net/preg_match to match particular pattern. IKE is SQL operator and has different purpose. what you are asking is callled validation. validation whould be done before you make DB queries. check like operator here http:///w3schools.com/sql/operator_like.asp
  21. birbal

    PHP timezone

    http://php.net/manual/en/timezones.php here you can find list of supported time zone. you need to specify among these
  22. $caption is string , image is binary data. you need imagettftext() to write text in image.
  23. Programming is all about patience. It takes time to do something and more time to do it effectively. It is ongoing process more you do you get better. From my little past experances, I doubt there is any word 'perfect' in programming. If it would developer would not update, improve, fixes bug to their code bases. Just keep on writing and learn from the mistakes, dont stop. I have no idea about online coaching classes.But If you want to get someone to watch over you doing things i think you can get any internship on php job or do pair programming with someone or start or involve in any opensource. These are the case where your code get chances to reviewed by other developers. you can join local classes too. but i doubt any classes will overwatch every step you do or they will be able to spoonfed everything. End of the day you have to do things on your own. Other way would be try something simple to develop. Read books on programming and go back and check how you can improve your existing codes from what have you learnt from reading those books. and repeat it. There are many good books on the subject which can help alot to do better progamming if someone be dedicated to it
  24. It is hard to guide step by step for most of people here. At best here you can sort out problems which you are having with your coding, to do that you need to be specific about which is not working and how do you want to work and any specific errors (if available) you are getting. Also you need to be comfortable with the basic at least. If you are in hurry and want to avoid learning curve you can give a try to any css framework. Also for client side debugginh it would be suitable if you put it online so people can test it themselves.
  • Create New...