Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by birbal

  1. JSG has already given you the answer but apart from that if you want to track on execution time of php scripts you can install xdebug and enable to 'cachegrind' http://www.google.co....47883778,d.bmk which will profile your script. you can use wincache application or webgrind (web based cachegrind viewer) http://www.google.co....47883778,d.bmk to view the profiling in user friendly GUI
  2. 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.
  3. check this http://dev.mysql.com/doc/refman/5.6/en/innodb-foreign-key-constraints.html
  4. Check for mysql error using http://php.net/mysql_error. Be sure of your username and password
  5. mysqli has both OOP and modular API. modular API is quite same as mysql API. it have mysqli_query() it has another identical method in OOP. Query itself dont get changed with different API. SQL remains same.http://php.net/Mysqli
  6. 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.
  7. I cant see anything from the posted code which is returning that error message. You must have connect to database before you do anything with database. 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.
  8. check what does return mysql_query() and even query get successfully get executed or not. You can use mysql_error() to print any error mysql encounters
  9. Answer is already given.. Please read the other posts.Click this link and tell what you seeHttp://localhost/mylife.php
  10. Have you checked googl map api?
  11. How do you know php is working in other case?
  12. Code inside php block will not be parsed as php unless you call the page via webserver eg localhost. Other html code will be sent to browser as text and will be interpreted and shown as html pageYour can execute your page from http://localhost/myfile.phpWhat do you see when you run it
  13. You are opening the file localy which wont execute php. You need to use http://localhost/location/to/your/file.phpAlso you need to put the file in web root. In xampp there a 'htdocs' dir which is webroot in xampp
  14. It should work with curly braces too. it is called interpolation, if a variable enclosed in curly braces inside double quotes it will evaluate its value.
  15. 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.
  16. 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.
  17. 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.
  18. 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.
  19. birbal

    MySQL backup

    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.
  20. 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.
  21. I suspect you are not calling the function displayPath(). are you calling it somewhere? if it does not get called it wont execute so it wont show any runtime error or do anything.
  22. you can use isset(), empty() to determine that inputs does not submited empty. you should always validate every input from user before you use it in system. http://php.net/issethttp://php.net/empty
  23. 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
  24. 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..
  25. You can use either. they can both do the things you want. With PHP you probabl;y will get better support.
  • Create New...