Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
HaVoC
Forum Commoner
Posts: 83 Joined: Sat Feb 07, 2004 7:20 am
Location: Smiths Falls, CA
Post
by HaVoC » Sat Feb 07, 2004 8:56 pm
It's a very simple counter.
їphp]
$query2 = "UPDATE counter SET number = ' .$number. ' + 1 WHERE id = 1";
ї/php]
It doesn't seem to want to add number + 1, any ideas. Also i'm trying to incorporate images into the script. How can I make the script define different numbers in the script and display them image?
?>
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Sat Feb 07, 2004 10:53 pm
$query2 = "UPDATE counter SET number = number + 1 WHERE id = 1";
How can I make the script define different numbers in the script and display them image?
Not too sure what you mean. Do you mean display a random image based on 'some number' ?
HaVoC
Forum Commoner
Posts: 83 Joined: Sat Feb 07, 2004 7:20 am
Location: Smiths Falls, CA
Post
by HaVoC » Sun Feb 08, 2004 8:45 am
More like this. Say the number was 189.
It would display the image 1.jpg, 8.jpg, and 9.jpg
DuFF
Forum Contributor
Posts: 495 Joined: Tue Jun 24, 2003 7:49 pm
Location: USA
Post
by DuFF » Sun Feb 08, 2004 5:05 pm
Example:
Code: Select all
<?php
$number = "187";
echo $number[0]; //echos "1"
echo $number[1]; //echos "8"
echo $number[2]; //echos "7"
echo $number[0] . ".jpg"; //echos "1.jpg"
?>
That help?
HaVoC
Forum Commoner
Posts: 83 Joined: Sat Feb 07, 2004 7:20 am
Location: Smiths Falls, CA
Post
by HaVoC » Thu Feb 26, 2004 3:48 pm
How would I make it so. Incase it goes to 4 numbers it does the arraying automatically. Or would it be so hard that just adding some code would do it?