{"id":1841,"date":"2018-10-23T20:44:07","date_gmt":"2018-10-23T20:44:07","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=1841"},"modified":"2022-02-17T07:14:02","modified_gmt":"2022-02-17T07:14:02","slug":"php4-delete","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/mysql\/php-versions\/php4-old-code\/queries-php4-old-code\/php4-delete","title":{"rendered":"PHP4 DELETE"},"content":{"rendered":"<pre>\r\n<code>\r\n  $result = @mysql_query(&quot;DELETE FROM some_table WHERE email_address=&#39;$email&#39;&quot;);\r\n<\/code><\/pre>\n<h4>\nDelete old records by date<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n  $result = @mysql_query(&quot;DELETE FROM messages_sent WHERE created_date &lt; DATE_SUB(NOW(), INTERVAL 30 DAY)&quot;);\r\n\r\n  \/\/Also:\r\n  \/\/INTERVAL 1 MONTH\r\n  \/\/INTERVAL 1 HOUR\r\n  \/\/etc\r\n<\/code><\/pre>\n<h4>\nDelete table<br \/>\n<\/h4>\n<p>\nTruncate is the fastest method to delete all data in a table as the table is dropped and re-creaed.\n<\/p>\n<pre>\r\n<code>\r\n$result = @mysql_query(&quot;TRUNCATE TABLE all_songs&quot;);\r\n<\/code><\/pre>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>$result = @mysql_query(&quot;DELETE FROM some_table WHERE email_address=&#39;$email&#39;&quot;); Delete old records by date $result = @mysql_query(&quot;DELETE FROM messages_sent WHERE created_date &lt; DATE_SUB(NOW(), INTERVAL 30 DAY)&quot;); \/\/Also: \/\/INTERVAL 1 MONTH \/\/INTERVAL 1 HOUR \/\/etc Delete table Truncate is the fastest method to delete all data in a table as the table is dropped and re-creaed. $result = [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[156],"tags":[],"class_list":["post-1841","post","type-post","status-publish","format-standard","hentry","category-queries-php4-old-code"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/1841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=1841"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/1841\/revisions"}],"predecessor-version":[{"id":1842,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/1841\/revisions\/1842"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=1841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=1841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=1841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}