Re: move "if" logic from php into query

From: Date: Thu, 26 Apr 2007 08:45:18 +0000
Subject: Re: move "if" logic from php into query
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-253828@lists.php.net to get a copy of this message
Thufir wrote:
I couldn't get the page to load when the logic for line 31, "($id == $_POST[recordID])", was in the query. Can the logic for that be moved to the query? I expect so.
$query = "SELECT contacts.id, px_items.id, title, notes FROM contacts, px_items WHERE contacts.id=px_items.id AND recordid='" . (int)$_POST['recordID'] . "'"; The (int) will make sure that it is a number (so a string becomes "0"). -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#253828) next »