data type trouble in php

Posted by user225269 on Stack Overflow See other posts from Stack Overflow or by user225269
Published on 2010-04-24T04:09:28Z Indexed on 2010/04/24 4:13 UTC
Read the original article Hit count: 166

Filed under:

I don't know why but the data type in this code makes a trouble when the id in the url starts with the number zero like this: http://localhost/exp/update.php?id=03A43 In this case the id is 03A43.

And my query looks like this:

mysql_select_db("school", $con);
   $result = mysql_query("SELECT * FROM student WHERE IDNO=".(int)$_GET['id']);

?>  

There is no problem in the design if the id does not start with the number zero. What might be the proper data type for numbers beginning in zero?

© Stack Overflow or respective owner

Related posts about php