Re: move "if" logic from php into query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux