I've been doing PHP for all of a few days and was wondering how to substitute a numeric value in a database statement. With string values it is straightforward, eg.
$Comment="hallo world";
$Query = "SELECT * FROM mytable WHERE comment = '$Comment'";
The above code will work fine, however what if I am substituting a number instead, eg.
$num = 1;
$Query = "SELECT * FROM mytable WHERE number = $num";
The above code doesn't work. Using the same syntax as before ie. '$num' doesn't work either. It shouldn't anyway because the field I am refering to isn't a string.
Thanks in advance for any help.
Pete...