delete some field in database
Moderator: General Moderators
delete some field in database
how would you delete some entries inside the mySQL database without dropping it?
if you want to delete an entry, you should just use DELETE query.
Refer to your manual for more indepth documentation that was included in your mysql distribution, or refer to mysql's site.
here's an example though :
if you are wanting to just drop a field from the table, use this :
Refer to your manual for more indepth documentation that was included in your mysql distribution, or refer to mysql's site.
here's an example though :
Code: Select all
mysql_query("DELETE from loginfo where user = 'bob'");Code: Select all
mysql_query("ALTER TABLE `mytable` DROP `my_column_name_to_drop'");If wanted to clean out the entire table-data, but leaving the layout as is:
Code: Select all
TRUNCATE TABLE;