PHP - MySQL - INSERT INTO not executing -


I have a problem ... for some reasons my MySQL query does not perform.

query:

  $ sql = mysql_query ("user` (` username ',' password`, 'first_name', 'last_name`, `email`,` Rank ', include `active`) value (` $ user name', `$ encrypted password ',` $ first_name`, `$ last_name`,` $ email`, `member`,` 0`));   

I do not know why this is not working: (no value is null and I do not get any errors.

You are using brackets for your value

  (`$ username`, `$ Encrypted password,` $ first_name`, `$ last_name`,` $ email`, `member`,` 0`)   

replace them with single quotes.

  ('$ username', '$ encrypted password', '$ first_name', '$ last_name', '$ email', 'member', '0')   < P>  or die (mysql_error ())  to  mysql_qu Ery ()  would have indicated an error.  

Consider using Sidenote:

  • They are much safer.

    In the bus case: < / Em>

    Add to the top of your file that will help during a production test. error_reporting (E_ALL); Ini_set ('display_errors', 1);

    • If you are not doing this already. an insight (which was previously here but removed it and added it back )

      I saw that you are using the variables for most of your values ​​only to make sure that you have $ member as opposed to member and If you want to enter the word for its matching value, then this should be the case; I have seen that before ( just check ).

      The use of error checking / reporting will tell you that you have mysql_error () .

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -