Search the Community
Showing results for tags 'rand()'.
-
what am i doing wrong? I can't see it... I want to catch the rand variable but it doesn't. So I print an extra print at the bottom. So there should be two rand prints. Here's the code. <html> <head><title></title> </head> <body> <form action='random.php' method='post'> <?php if(isset($_REQUEST['rand'])){ $rand = $_REQUEST['rand']; print $rand . "<br /><br />"; } else { print "rand: empty<br /><br />"; } $rand = rand(1,1000); print $rand."<br /><br />"; print "<input type='hidden' value='$rand' />"; ?> <input type='submit' value='scramble' /> </form> </body> </html> I forgot to tell ya that the if statement returns rand: empty. Help...
-
I'm stumped on how to get this join to work: Statement: SELECT * FROM votes WHERE NOT EXISTS (`votes`.`poll_id` = `user_votes`.`vote_poll_id` AND `user_votes`.`user_id`='1') limit 1 order by rand() Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`votes`.`poll_id` = `user_votes`.`vote_poll_id`) limit 1 order by rand()' at line 3 Possibly, but doubt it: the table is completely blank. Goal: Find all the entries that the user hasn't voted on as of yet, then submit them randomly to the user.
- 19 replies
-
- not exists
- rand()
-
(and 1 more)
Tagged with: