| | |
Duplicate entry '' for key 2
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
OK, what I mean is the following
$new_text is the variable name by which you refer to it in your code. The variable value is the value of $_GET['whatever'].
My question is - your string
looks exactly as you would have it typed into your code.
But when you call the page wich contains ECHO "INSERT STRING HERE $variable"; and PHP parses the code - the html output should be something like
INSERT STRING HERE my value.
So what bothers me in your post is that if the HTML output of the echo command is exactly as you have it posted here, there is something wrong in the formatting of your php string.
Do you understand me better now?
$new_text is the variable name by which you refer to it in your code. The variable value is the value of $_GET['whatever'].
My question is - your string
PHP Syntax (Toggle Plain Text)
INSERT INTO `article_fields`(`field_title`, `field_type`) VALUES("'.$new_text.'","'.$field_type.'")
But when you call the page wich contains ECHO "INSERT STRING HERE $variable"; and PHP parses the code - the html output should be something like
INSERT STRING HERE my value.
So what bothers me in your post is that if the HTML output of the echo command is exactly as you have it posted here, there is something wrong in the formatting of your php string.
Do you understand me better now?
" Of all the things I've lost,
I miss my mind the most...."
Mark Twain
I miss my mind the most...."
Mark Twain
the ` (which are different than ') are not necessary, but I see phpMyAdmin and other programs use them a lot so it kind of became a habit of mine. it also helps me identify database and table names in the queries i write. i wrote the column names in so we could avoid silly errors that i figured s/he would have.
cali_dotcom:
if you have some code to look at, post it. maybe we can find if something else is preventing this from working, because i know the sql i posted works.
cali_dotcom:
if you have some code to look at, post it. maybe we can find if something else is preventing this from working, because i know the sql i posted works.
![]() |
Similar Threads
- MySQL installation problem (*nix Software)
- Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource (PHP)
- c++ letter coding (C++)
- constraints (C#)
- PHP MySQL problem (PHP)
- INSERT INTO doing double duty (MySQL)
- Validation for the primary key in the database (JSP)
- duplicate entry through web form into oracle (Python)
Other Threads in the PHP Forum
- Previous Thread: Urgent help needed! Transaction process after shopping cart
- Next Thread: how to access accessing PHP variable in JavaScript
| Thread Tools | Search this Thread |
apache api array autocomplete beginner binary body broken cakephp class cms code cron curl database dataentry date date/time display duplicates dynamic ebooks email emptydisplayvalue error execute explodefunction file firstoptioninphpdroplist folder form forms function functions google href htaccess html image include ip javasciptvalidation javascript joomla keywords limit link list login matching mediawiki menu msqli_multi_query multiple mycodeisbad mysql navigation number oop parameter paypal pdf php phpincludeissue query random recourse recursive regex script search seo server sessions shot source sp space speed sql static subdomain subscription system table tag tutorial tutorials update upload url validator variable vbulletin video web webdesign white xml youtube






