is it possible to enter details into a database with a random number for the id ??
instead of it going...1, 2, 3, 4, 5,............
even if it was like a 10 digit randon number.....
please help
if your id field in an auto_increment field, you could turn off auto_increment, create a random number using something like rand(100000,999999) query the database to make sure that id generated doesnt already exist in it, and then insert if it doesnt, or create a new id if it does.
and how would i created that code tht would check this
$success = FALSE; while($success == FALSE) { $rand = rand(100000, 999999); $q = "SELECT * FROM table WHERE id = '$rand'"; $r = mysql_query($q); if(mysql_num_rows($r)) { //id exists continue; } else { $success = TRUE; } } //insert your data here with $rand as the id