Using simple test scripts, I'm connecting to a MySQL DB through PHP after
inputting info into a form and hitting submit. Something is putting three
records instead of one into the mySQL DB.

For instance:
the two variables are: $event_title and $event_desc. These are gotten from
the form submitting to the PHP doc. The PHP code is as follows:


$link = mysql_connect("localhost", "llupien", "dod2196");
if (! $link)
 die ("Couldn't connect to MySQL");
mysql_select_db("scco") or die ("Couldn't open database phptest");
$query = "INSERT INTO events (title,description) values
mysql_query($query, $link) or die ("Couldn't add data to table:


It's simple and I know the syntax is right...but in my simple little table,
I get three records - one correctly entered and two blanks. The two blanks
force the autonumber ID field to increment, but are completely blank
otherwise. Why would I get three records?

I use MySQL and PHP with my hosting service...they have PHPMyAdmin
installed...when you add a record from PHPMyAdmin, it works peachy. So
something PHP is working just fine, just not *my* scripts.

One of my theories is that it's something about the way I
connect..."localhost" may be wrong or need a port?? I've asked them over and
over what the connection requires but they don't seem to know what they're
talkign about. They keep telling me the pathway "usr/local/mysql" etc, but
can't tell me how to connect to the mySQL db's.

Anyway, it might be hopeless, but I'm hoping someone can lead me in the
right direction. Thanks!

PHP Database Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to