Soldato
- Joined
- 24 Nov 2002
- Posts
- 16,378
- Location
- 38.744281°N 104.846806°W
I have an incredibly simple database set up at the moment with data such as:
1 Tom
2 Dick
3 Harry
4 Hippo
5 Charlie
(literally the two columns)
At the moment I'm using:
Where "num" is the number passed via post. I'm just echoing number = name.
for example, blah.php?num=1 would yield "1 = Tom".
This works dandy, but how would I treat it if I passed: "1,2,5" to output:
1 = Tom
2 = Dick
5 = Charlie
I appreciate this is extremely simple and duly apologise!
1 Tom
2 Dick
3 Harry
4 Hippo
5 Charlie
(literally the two columns)
At the moment I'm using:
Code:
$query="SELECT * FROM $type WHERE num='$num'";
Where "num" is the number passed via post. I'm just echoing number = name.
for example, blah.php?num=1 would yield "1 = Tom".
This works dandy, but how would I treat it if I passed: "1,2,5" to output:
1 = Tom
2 = Dick
5 = Charlie
I appreciate this is extremely simple and duly apologise!