JSHINER Posted April 15, 2008 Share Posted April 15, 2008 Have a quick question. $id = 000017 When I do the following: WHERE table.id = '$id' AND table.other = table2.other I get no results. But when I do: WHERE table.id = '000017' AND table.other = table2.other I get results. Am I missing something simple here? I'm sure I am, been a very long day. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted April 15, 2008 Share Posted April 15, 2008 if $id is being interpreted as an int in php it will remove the leading zeros. use fprint or str_pad to put the zeros back on. http://www.php.net/sprintf, example 7 Quote Link to comment Share on other sites More sharing options...
JSHINER Posted April 15, 2008 Author Share Posted April 15, 2008 No go. If I do echo $id it displays 000017. Where does it get changed to 17? Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted April 15, 2008 Share Posted April 15, 2008 echo out your entire query and post that. Quote Link to comment Share on other sites More sharing options...
JSHINER Posted April 15, 2008 Author Share Posted April 15, 2008 I knew it was something simple Had the $id = $_POST['id]; outside the function. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.