birbal

Members
  • Content count

    2,543
  • Joined

  • Last visited

  • Days Won

    36

birbal last won the day on March 4 2014

birbal had the most liked content!

Community Reputation

168 Excellent

About birbal

  • Rank
    Devoted Member
  • Birthday 05/13/1990

Previous Fields

  • Languages
    (x)html,css,(pl)sql,php,xml,xslt,xsd,javascript,java

Contact Methods

  • Website URL
    http://
  • ICQ
    0
  • Yahoo
    gourav.sarkar13@yahoo.com

Profile Information

  • Gender
  • Location
    india->kolkata
  • Interests
    everything about computer and programming:specifically Web development and everything others which makes me interested
  1. If you are using php 5.4 and up you can use http://php.net/SessionHandlerInterface in conjugation with http://php.net/session_set_save_handler (one of its version takes callback style parameter which are used prior to php 5.4
  2. & is not special character in context of string literal. It will be treated as character inside double and single quotes.
  3. You can still help people and answer their question without being mod
  4. Check what does $_POST['sort'] returns. Use var_dump()
  5. you can use union SELECT * FROM tran WHERE aid IN('1','2') AND tr_type NOT IN ('SALES','PURCHASE'))UNIONSELECT * FROM tran WHERE aid NOT IN('1','2')
  6. I am not sure from where you get the error message. if page does not exist it would show error 404. currently it will try to redirect to file named chkactivasion.php on same directory as login.php. make sure file URI is correct.
  7. SELECT * FROM tran WHERE NOT IN(SELECT aid FROM tran WHERE aid IN ('1','2') AND tr_type IN ('SALES','PURCHASE'))
  8. Well, I forgot header() does return void. I recalled it would return boolean (on success/failure) and thought different thing. NVM. Back to your problem. "This page can't be displayed" does it show error 404?
  9. Is it the all code? I cant see anything in this code which can do like it.
  10. header() should not be inside die(). you can use header() to redirect and the may call die()
  11. You can export and import database and tables. phpmyadmin has option for doing so.
  12. I believe he meant t http://php.net/list
  13. using TRUNCATE will set AI to 0 as well as empty the table. http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CCkQFjAA&url=http%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.0%2Fen%2Ftruncate-table.html&ei=x4NbU9reJsSXrAe94IDgDg&usg=AFQjCNGl0K-EgA3InY7R303XP6MwoNTFOw&bvm=bv.65397613,d.bmk
  14. please Dont be confused. you can go either way with pdo or mysqli. if code with one of them is not working dont switch it to another. it wont help anything. as you are starting stick with any one of them. as already told, phpmyadmin is nothing but a php application which interacts with mysql server. so if you can work with phpmyadmin, it is obvious that you have mysql,apache and php is up and running. after that if something in your code is not working dont assume and try to debug things. $dbconn = new PDO(mysql:host = $db_server; $db_name; charset = utf8, $db_user, $db_password); $dbconn->setAttribute(PDO::ATTR_ERRORMODE,PDO::ERRORMODE_EXCEPTION); //It will throw exception when an error occurs. it will also show the reason of error with error message unless it is for educational purpose table creation (or any other DDL part) usually does not happen in php scripts. you set up the table in phpmyadmin. and mostly use Database Query Language(DQL) or DML from your php script.
  15. It is for placeholder where you will insert data to database. As for original post, you can also just insert query as usual and catch the exception on error. Every error has certain codes, so thus duplicate entry has one. just check the codes and do whatever you need to do. You have to make sure though to enable Exception mode of error reporting on PDO. Even further you can parse the error message to find which key is being violated for duplicate entry. Error message have certain fixed format so you can catch the names of the keys too.