Jump to content

Random file help ?


Net123

Recommended Posts

Generate what from what?What is "random file" supposed to mean? Random file name for a certain known file with certain data? Or a file with certain name with some kind of contents based on random data?By "files table" do you mean a table in an SQL database which contains... what? File paths of some sort?

Link to comment
Share on other sites

I have stored my file's from 'files' table to my server just i wanna generate a name from the record's can you help me

Link to comment
Share on other sites

do you have any unique id associated with file name in db?

Link to comment
Share on other sites

yes i am using this code 'id' int(11) NOT NULL auto_increment,'path' text NOT NULL,'infolder' text NOT NULL,'name' varchar(255) NOT NULL,......... etc etc

Link to comment
Share on other sites

then you can use rand to generate a random number. then query with it appending the number in WHERE caluse...something like

SELECT * FROM table WHERE id=somerandnumber

Link to comment
Share on other sites

But how to i generate a file name from files table (not a random number )i want to generate an file name from my server using sql

Link to comment
Share on other sites

Wow really very thanks bro i gonna for try this

If you're trying to get a random record, you can do this:SELECT * FROM files ORDER BY RAND() LIMIT 1
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...