13 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for mpc123

Hi im trying to random showing items from data base and when echoed the same ones appear? If anyone could help that would be great. This is the query SELECT * FROM TABLE1, TABLE2 WHERE FIND_IN_SET(TABLE2.FIELD1, TABLE1.FIELD1) and `FIELDNAME` >= RAND() LIMIT 10

Member Avatar for pritaeas
0
146
Member Avatar for lukas.vandendijssel

Hello, Somehow this is not working. I tried pretty much everything. I am also very new to PHP, but i made a nice CMS. Now I am making a website with some random flash-videos every time you refresh. This is what i got so far: <html> <head> <title>Sydcul.com</title> </head> <body> …

Member Avatar for bradly.spicer
0
313
Member Avatar for LastMitch

Hi, I'm trying to preventing consecutive duplicate pages. For example when I refreshed a page it show a word from each page and when I refresh again it should show a different word from a different page not staying on one page. This is my pages: Page1 = Mozart Page2 …

Member Avatar for LastMitch
7
434
Member Avatar for nishad_forums

Hi, I have googled but found nothing about this. I am trying to generate a random number from a given array. But how do i do it? **Suppose:** I have an array `int arr[]={3,89,99,4,55};` and i want to generate a random number among these numbers. thanks in advance.

Member Avatar for nishad_forums
0
309
Member Avatar for moonw3ll

Just what is wrong with this simple code of mine? [CODE]#include<stdio.h> #include<string.h> #include<stdlib.h> main() { int i=0, num; char a[8]; char keyword[8]; system("cls"); while(i<8) { num = rand()%3; if ( num == 0 ) a[i] = 65 + rand()%26; /* 65 is the ascii value of A */ else if …

Member Avatar for moonw3ll
0
233
Member Avatar for ineedsomehelp:3

Ok, I need to make a program that randomly generates 4 random letters from 12 random letter and it cannot reapeat the same letter. for example you can only pick from a,b,c,d,e,f,g,h,i,j,k,l and the program can randomly generate a,b,c,d or b,c,d,e but should not generate a,a,b,b or something that repeats.Another …

Member Avatar for ineedsomehelp:3
0
378
Member Avatar for benjybob

hi, i have a small problem with the rand operator. at first i tried using it without srand but gave me the same value each time. i have inserted srand(time(0)); but my compiler throws me up these errors: 1>c:\users\ben\documents\university work\year 2\c++\code\myc++\spritelab\asteroidsgame.cpp(17): error C4430: missing type specifier - int assumed. Note: …

Member Avatar for benjybob
0
418
Member Avatar for VP2

Hello! I've got a little problem... I want to make a program which puts 10 random character, but the characters should NOT be digits. [CODE]#include <ctime> #include <stdio> #include <iostream> using namespace std; int main() { time_t t; time(&t); srand(t); int i,c; char ch; printf("Generating 10 random characters...\n"); for(i=1;i<=10;i++) { …

Member Avatar for WaltP
0
150
Member Avatar for Dante2

Call me a noob, but is there a way to use [B][I][U]just[/U][/I][/B] PHP to create a photo slideshow? Or do you need to use flash? I have code that will display images in a random sequence, which is fine. [CODE=php]<?php $pic = rand(1,15); print "<img src=\"images/$pic.jpg\" height=\"100\" width=\"140\" />"; ?>[/CODE] …

Member Avatar for Dante2
0
189
Member Avatar for vavazoom

I'm trying to create a random float generator. The float must be 2 decimal places and between the values 0.50 and 999.99. I tried casting rand() to a float below, which didn't work. I'd still like to know the reason this didn't work. [CODE] saleAmount = ((float)rand() % 99950.00 + …

Member Avatar for vavazoom
0
270
Member Avatar for TheBaby7591

This is the code I have so far. I can't even get the numbers range to print to the screen correctly. I am very new to all this stuff so go eacy on me. Can anyone help?? [code=c] #include <stdio.h> #include <stdlib.h> #include <math.h> #include <time.h> int main() { unsigned …

Member Avatar for TheBaby7591
0
110
Member Avatar for kirtan_thakkar

I am using the code as under but always getting 0 value means the same folder [code=php] $random_folder=array("folder1","folder2","folder3"); $folder=$random_folder[rand(0,count($random_folder)-1)]; [/code] Getting folder1 always.. What's wrong?? Please Help.......

Member Avatar for msm_eg
0
157
Member Avatar for naseerhaider

Hello Every one ! This program is producing some strange output as it is only generating x = 6 :(,can some through some light that why is it behaving like this ? [code] #include <iostream> #include <stdlib.h> using namespace std ; main () { // Random Number Program int num,x …

Member Avatar for naseerhaider
0
163

The End.