Jump to content

birbal

Members
  • Posts

    2,543
  • Joined

  • Last visited

Posts posted by birbal

  1. All php resources will be destroyed at the end of the script including PDO. It wont matter for small script. But if after opening a connection there is lot of time consuming task your script is doing, connection will be still opened. with that kind of simultanouse call to script can exceed your maximum mysql connection. You can check the variable to see what does it holds to ensure you have active connection or not.

    • Like 1
  2. Both do same it pulls the file (something like interpreter handled copy paste) and if file extension supports to parse or execute it will parse it eg when you use require_*() to php file. The only difference between both is. require_once() maintain a hash table which consists of list of file it is already included. Where as require() does not have that and try to include same file as many times it encounters. As require_once() check its hash table before any inclusion of files it is little slower (academically) than require(). though it is negligible.Usually you would use require_once() where you must have to include a file for one time, like class,function declaration Where as you can use require() in repetitive scenario.

  3. I cant see anything from the posted code which is returning that error message.

    I dont know if the page is going to log in only after i have developed and connected the database?
    You must have connect to database before you do anything with database.
    I'm not getting the registration email after i have registred,
    There could be many reasons for that (Assuming it register user to database but dont send email). To send email you need to have a email sever. from localhost you would neeed a sendmail like server and configure it properly to send email from your local server. Though some ISP may block email traffic. Third party sever usually have email server up and running. Some Email provider would block email too for spam. You can check spam folder of your email account too.
  4. If it is showing the php code it means it is not executing php. It could be for several reason.If you have not php installedif you have not apache module of php not configured to execute php fileYou are not using localhost when calling the page. if you open the page using local file without using localhost it wont execute As for XAMPP installation you should not have face first two reason as they take care of the configs for convenience and it should work almost instantly.

  5. It is the one of the 3 error mode in PDO. if error mode is set to ERRMODE_EXCEPTION it will throw exception when an error occurs in database. There is more two mode-silent,warning. warning will show error as PHP warning without halting the script. Where as silent will do nothing, you need to use errorInfo() or errorCode() to see the errors. using exception is better option among the others.

  6. That is fairly vague question.You have to be specific You need to first write down he project requirements., without it is hard to guess what does the online school admission system suppose to do..You need to identify the system task and break those task to subtasks and approach each subtasks and solve them.

  7. Browser caching will be same as long as the whole URL is same. Search engine will crawl links normally and will index it. If you provide a sitemap for the site things will be much better. Though dynamic link like ?id=2 can affect verbosity of the URL which is an important in SEO optimization. You can though use URL rewriting to format the url in verbose way.

    • Like 1
  8. Both will be effective. mysqldump can be set up to backup data in interval. Whereas you have to use phpmyadmin manually to backup the data.

    • Like 1
  9. if(!empty($_POST['subject'] && !empty($_POST['message']) //List of required field{ //Process data mail(....);}else{//show error} link on post 2 will help you to get idea how does these functions work.

  10. PDOstatement::rowCount() should be used with only DML statements like INSERT,UPDATE,DELETE. Behaviour of SELECT is not same for all database driver, thus use of it for this purpose, is discouraged. You can check return value of fetch() to determine if it is returning any row or not. it should return false when there is no row. in your select statement you dont even need a loop, as there should only one password username combo. if you use fetchAll() you can use count() to determine the element number it found in database

  11. database location is usually 'localhost', password is empty or any password you may have set at the time of installation, username is usually root. though there could be any user name you can create and password for each of them from mysql..

    • Like 1
×
×
  • Create New...