If I understand you correctly
query_posts('p='.$number);
must work.
If you need a single quote ' per line, you can escape '
query_posts('p=\''.$number.'\'');
or using double quotes (more elegant, and you can put the variable right inside. Dominic already suggested this in his answer)
query_posts("p='$number'");
Pekka ė Feb 10 '10 at 15:01 2010-02-10 15:01
source share