birbal
Members-
Posts
2,543 -
Joined
-
Last visited
About birbal
- 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
-
Location
india->kolkata
-
Interests
everything about computer and programming:specifically Web development and everything others which makes me interested
Recent Profile Visitors
15,957 profile views
birbal's Achievements
Devoted Member (5/7)
168
Reputation
-
Jahangiralomminto started following birbal
-
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
-
& is not special character in context of string literal. It will be treated as character inside double and single quotes.
-
You can still help people and answer their question without being mod
-
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.
-
Is it the all code? I cant see anything in this code which can do like it.
-
You can export and import database and tables. phpmyadmin has option for doing so.
-
I believe he meant t http://php.net/list
-
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
-
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.
-
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.