<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Code The World — Delete data from a MySQL database]]></title>
	<link rel="self" href="https://codetheworld.com/extern.php?action=feed&amp;tid=8&amp;type=atom" />
	<updated>2010-01-02T13:25:33Z</updated>
	<generator>PunBB</generator>
	<id>https://codetheworld.com/viewtopic.php?id=8</id>
		<entry>
			<title type="html"><![CDATA[Re: Delete data from a MySQL database]]></title>
			<link rel="alternate" href="https://codetheworld.com/viewtopic.php?pid=373#p373" />
			<content type="html"><![CDATA[<p>This would, if register_globals was set in the php.ini. It the server was using PHP5 it is unlikely however I do think that in the earlier versions of PHP4 it was turned on, an attacker could simply make the request...</p><p><a href="http://example.com/path/to/file.php?id=1">http://example.com/path/to/file.php?id=1</a></p><p>and it would delete the table with an id of 1, this is easily scriptable so that it would go through and increment the id number until all the id&#039;s were completed</p>]]></content>
			<author>
				<name><![CDATA[Alias]]></name>
				<uri>https://codetheworld.com/profile.php?id=406</uri>
			</author>
			<updated>2010-01-02T13:25:33Z</updated>
			<id>https://codetheworld.com/viewtopic.php?pid=373#p373</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Delete data from a MySQL database]]></title>
			<link rel="alternate" href="https://codetheworld.com/viewtopic.php?pid=17#p17" />
			<content type="html"><![CDATA[<p>Does this pose a potential security risk?</p>]]></content>
			<author>
				<name><![CDATA[hotaussie]]></name>
				<uri>https://codetheworld.com/profile.php?id=15</uri>
			</author>
			<updated>2008-06-15T02:29:27Z</updated>
			<id>https://codetheworld.com/viewtopic.php?pid=17#p17</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Delete data from a MySQL database]]></title>
			<link rel="alternate" href="https://codetheworld.com/viewtopic.php?pid=8#p8" />
			<content type="html"><![CDATA[<p>Description<br />How to remove and erase stored information from a MySQL database table.</p><p>The code<br /></p><div class="codebox"><pre><code>&lt;?php

/*
 * Change the first line to whatever
 * you use to connect to the database.
 *
 * Change tablename to the name of your 
 * database table.
 *
 * This example would delete a row from
 * a table based on the id of the row.
 * You can change this to whatever you
 * want.
 */

// Your database connection code
db_connect();

$query = &quot;DELETE FROM tablename WHERE id = (&#039;$id&#039;)&quot;;

$result = mysql_query($query);

echo &quot;The data has been deleted.&quot;;

?&gt;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Casper]]></name>
				<uri>https://codetheworld.com/profile.php?id=5</uri>
			</author>
			<updated>2008-06-15T01:05:54Z</updated>
			<id>https://codetheworld.com/viewtopic.php?pid=8#p8</id>
		</entry>
</feed>
