Re: a weired query issue

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

 



At 1:35 PM +0530 1/8/09, viraj wrote:
i have this query..

$sql = "SELECT `id` FROM `modules_permissions` WHERE `id` = '" .
$permissionId . "';";

when i pass the value 31 to permissionid, it returns me the 31st row
of the table. and it's fine. but when i pass '31asasa' as the
permissionid it returns me the same row! how come this possible?

`id` is a integer and the storage engine is myisam. i'm on debian and
mysql version is 5.0.51a-15

~viraj

As Nate said, that's normal.

However, what I noticed was a query that is more complicated than it could be, try this:

$sql = "SELECT id FROM modules_permissions WHERE id = '$permissionId' ";

That should work, it does for me. If it doesn't, I would like to know why?

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.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