Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your use of mysql_query is deprecated as of PHP 5.5.0 and will be removed in the future. You should start using <a href="http://www.php.net/manual/en/book.mysqli.php" rel="nofollow">MySQLi</a> or the <a href="http://www.php.net/manual/en/ref.pdo-mysql.php" rel="nofollow">PDO_MySQL</a> extension. </p> <p>I would further suggest you store your query:</p> <pre><code> DELETE ProductData.* FROM ProductData INNER JOIN AllProducts ON ProductData.ProductNumber = AllProducts.ProductNumber WHERE (ProductData.AccountID = '100001' AND AllProducts.ProductOwner = 'TOM' </code></pre> <p>In a stored procedure on the database.</p> <p>When using PDO's for example, you can call it as follows:</p> <pre><code> $db = new PDO('mysql:host=xxx;port=xxx;dbname=xxx', 'xxx', 'xxx', array( PDO::ATTR_PERSISTENT =&gt; false)); // Be sure to cleanse the passed in arguments! $stmt = $db-&gt;prepare("CALL deleteProductData($accountId, $productOwner)"); // call the stored procedure $stmt-&gt;execute(); </code></pre> <p>Stored procedure example:</p> <pre><code>CREATE DEFINER=`root`@`localhost` PROCEDURE `deleteProductData`(IN `accountId` BIGINT, IN `productOwner` VARCHAR(128)) LANGUAGE SQL NOT DETERMINISTIC CONTAINS SQL SQL SECURITY DEFINER COMMENT '' BEGIN DELETE FROM ProductData INNER JOIN AllProducts ON ProductData.ProductNumber = AllProducts.ProductNumber WHERE ProductData.AccountID = accountId AND AllProducts.ProductOwner = productOwner; END </code></pre> <p>This way you are moving all MySQL code out of php and into the database, where it belongs.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload