Jump to content

[SOLVED] deleting blank rows


jakebur01

Recommended Posts

It depends on the type of field and the current value for "blank" rows.. Look at the data in your table and see what value is in the part number field and use that in your delete statement.. If the field is really blank, then you would probably use:

 

delete from table where partnumber = '';

 

Or, if that field has NULL values for the blank ones, then you would use:

 

delete from table where partnumber = NULL;

 

Try this:

mysql_query("DELETE table WHERE partnumber = '' ");

 

Why don't you make a select statement that finds all the blank rows and print them out to make sure the delete query will be safe to do?

 

$sql = mysql_query("SELECT * FROM table WHERE partnumber="" ");

while ($row = mysql_fetch_assoc($sql)){
   echo $row['col'].'<br>';
}

Archived

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

×
×
  • Create New...

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.