Jump to content


This topic is now archived and is closed to further replies.


Firefox is adding blank row in mysql!!!?????

Recommended Posts

I have a php form that sets an ID auto increment insert whenever a new row (record) is added by form.

It works fine when submitted via IE.

But, when submitted via FF it adds a blank row to the DB table (along with the correct row) and auto increments them both (ex: id 07 & id 08)!

We scoured the code and could find no reason for it to do this. Then, I noticed, and removed, 2 small unecessary (and improperly used) image placeholders in two <td> tags:

<td><img name="placeholder" src="" width="32" height="1" alt="placeholder"></td>
<td width="220"><img src="" width="220" height="1" alt="" style="background-color: #FFFFFF" /></td>

When removed, it properly inserted one incremented row.

How could a static html tag (no matter how poorly entered) dynamically add an insert to a table?

For the static tags, I use validated w3c standard xhtml transitional (which the TD tags obviously didn't conform to).

I don't get it.

Share this post

Link to post
Share on other sites
No idea -- that makes no sense at all.

Share this post

Link to post
Share on other sites
[!--quoteo(post=339511:date=Jan 24 2006, 02:18 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Jan 24 2006, 02:18 PM) [snapback]339511[/snapback][/div][div class=\'quotemain\'][!--quotec--]
No idea -- that makes no sense at all.

LOL!!!! That's what we've been saying!

Okay, it has to be related to the fact that I am using w3c standard. That's really the only difference between FF and IE that could cause this.

THEREFORE, it MUST be something in the way we are instructing the php to INSERT and auto increment.

Okay. I just created a record and it worked fine. THEN I added the above html back to the table and WHAMMO! Duplicate blank entry!!!! I'm sorry, this is really really weird!

Here is the auto-increment command and the first of the insert commands (7 tables - 7 query inserts):

//get next available id number
$maxquery = "select * from setups order by id asc";
$max_result=mysql_query("$maxquery") or die(mysql_error());
while($result_row=mysql_fetch_array($max_result)) {
$id = $result_row[id];

//store data into setup table
$query = "insert into setups (id, address, city, state, location, block, lot, bldg_size, land_area, zoning, stories, description2, sale_price, contact, title, exclusive, show_address, form_type) values ('$id', '$address', '$city', '$state', '$location', '$block', '$lot', '$bldg_size', '$land_area', '$zoning', '$stories', '$description2', '$sale_price', '$contact', '$title', '$exclusive', '$show', '$form_type')";
$result=mysql_query("$query") or die(mysql_error());

//store data into photo table
$photo_query = "insert into photo....(I used same format as above for all of the queries)"

//store data into expense table
$expense_query = "insert into expense...

//store data into cost table
$cost_query = "insert into cost ...

//store data into income table
$income_query = "insert into income ...

//store data into date table
$date_query = "insert into date ...

//store data into rent table
$rent_query = "insert into rent...


Now. Someone tell me how would any subsequent html tag could add a row to the tables?


Share this post

Link to post
Share on other sites
Why are you getting the next UID like that? Seems very strange indeed -- and could cause two records to have UID collisions across different threads. Why do you care what the UID is? Let MySQL handle the auto-increment value on its own.

But I digress -- are you just getting a single extra record in one of the tables, or all seven? And I don't think it has anything to do with w3c at all.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.