Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CS4 and phpMyAdmin 2.11

New Here ,
Feb 05, 2010 Feb 05, 2010

   I'm using Dreamweaver CS4 and phpMyAdmin 2.11.3deb1ubuntu1.3 - I've created a page called test.php with two textboxes on it - Test and Test2. Each has an insert record behavior associated with it.  When I preview the page, I put 123 in Test and 456 in Test2.  When I look in the database table, it puts two rows.  One with 123 in Test and another with 123 in Test and 456 in Test2.  Will someone please help understand how to make the table not put the singular 123 in Test while keeping the 123 Test and 456 Test row?

TOPICS
Server side applications
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2010 Feb 06, 2010

$test1 = $_Post['test1'];

$test2 = $_Post['test2'];

$query="INSERT INTO test($test1, $test2) VALUES ($test1, $test2);"

mysql_query($query);

that's just ane xample of how your could could work but thaat's not the only option. You will also have to of course have a table set up called test.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2010 Feb 06, 2010

That sounds like mySQL lingo...it's pretty simple.  There are two textboxes inside a form field with a submit button.  Theoretically it should only put one row upon insertion into the database table.  But it doesn't.  It puts two rows.  one with data from Test AND Test2 textboxes into Test AND Test2 database fields.  It also inserts a second row...the one I don't want it to insert...it has data from the Test textbox but NOT Test2.  That I know of, I never told it to do that!  By default, I figured it would simply put the ONE row.   What the heck!?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2010 Feb 06, 2010

   It seems as though it is inserting the Test record twice...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2010 Feb 06, 2010

   Can and will anyone tell me why "It" does that?...I'm not sure if it's Dreamweaver or mySQL...it's just two fields...it should only have one row...right?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 06, 2010 Feb 06, 2010

That's mysql within php code. So once again... SHOW ME your code. Without your code i can't help you with anything. If you refuse to show me code, i cannot help you. NO one can help you without seeing what code you're doing. And it's not a dreamweaver issue, it's your code's issue. If you will not hsow the code i shall not even attmept to help you. as this is very basic code that everyone has to know to do any type of web application.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2010 Feb 07, 2010

   You say it's not dreamweaver...I have done nothing to PHP mySQL...except create a database table...when I "Browse" the table, the previously posted results occur.  The attached file has the two textboxes - Test and Test2 along with a form field and submit button.  Thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2010 Feb 07, 2010

   In order for someone to properly isolate the problem and solve the issue, they would need to know how I have PHP MySQL configured.  The database is: Tedocity    The database table is: db_table_personal   The field contents for Test and Test2 are set to "CHAR" with Length/Value set at 100 and utf8_general_ci.  Other than that, I have done nothing knowingly to cause the extra row.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2010 Feb 07, 2010

   I'm new to working with PHP MyAdmin.  If there is a way to show the MySQL code, I don't know how to do it at this time.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 07, 2010 Feb 07, 2010

The reason the values are being inserted twice is because you have two Insert Record server behaviors in that page.

Open the Server Behaviors panel, and you'll see both of them listed, as shown here:

tedocity.jpg

Select one of them, and click the minus button at the top left of the Server Behaviors panel to remove it.

To work successfully with PHP in Dreamweaver, you will need to learn both PHP and SQL. Without that knowledge, you'll be wandering around in a haze of confusion all the time. Fortunately, they're not all that difficult to learn.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2010 Feb 07, 2010

   Thanks for setting me straight on the "Insert Record" situation.  I can get Test to work. I'm just not sure how to add the second textbox...Test2.  I know this seems rudimentary to many.  I'm probably making more of a big deal of it than it actually is.  I believe if I can get a solid grasp on it though, I'll have a good foundation to proceed.  If you'll help, I'll greatly appreciate it.  Attached is Test.php with the singular Test textbox.  Thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 07, 2010 Feb 07, 2010

You have only one field in your form. To get an overall view of basic interaction with a database try the following tutorial: http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2010 Feb 07, 2010

   I appreciate the input...I'm much more interested in simpling seeing a page...preferrably titled Test.php that has two textfields contained in one form field...form1 with a submit button.  Please help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2010 Feb 07, 2010

since i'm guessing this'll turn into a login page, i'm going to make  it so that test1 and test2(the names of the text boxes) are both  inserted on the same row. Also to insert another textbox in the form you  just put something like...

<input type=text" name="test2" />

that's all you have tdo since you're working with a .php file and as far as i know, adobe doesn't let you insert elements as if it was html so it looks like you'll have to just type it in like normal so to speak. Also here is my version of this test.php it doesn't include any style sheets, nor javascript and all it does is gets teh job done as quick and as fast as possible.

edit: and in the future please use the edit button instead of clicking reply all the time. The other thing is, if you're interested in making a registration page in the future or maybe your own browser based game here is a link that i've learned from. http://buildingbrowsergames.com/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2010 Feb 07, 2010
LATEST

   I'm not diggin' it...anyone out there got a shovel?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines