Skip to main content
Participating Frequently
February 5, 2010
Question

CS4 and phpMyAdmin 2.11

  • February 5, 2010
  • 1 reply
  • 1150 views

   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?

This topic has been closed for replies.

1 reply

Participant
February 6, 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.

TedahAuthor
Participating Frequently
February 6, 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!?

TedahAuthor
Participating Frequently
February 6, 2010

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