Jump to content

birbal

Members
  • Posts

    2,543
  • Joined

  • Last visited

Posts posted by birbal

  1. 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]);

  2. 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.

  3. 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

  4. 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()

  5. 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?

  6. 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.

  7. 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.

  8. 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

  9. 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...