Jump to content

How can I loop this?


pneudralics

Recommended Posts

Let's say for some reason my md5 string is in the database. How can I repeat md5ing strings until one is not found?

 

<?php
$string = md5($_POST['string']);

if (isset($_POST['submit'])) {
$query = "SELECT * FROM table WHERE string = '$string' LIMIT 1";

if ($result = mysql_query($query)) {
$row = mysql_num_rows ($result);
	if ($row = 0) {
	//insert to database
	}
	else {
	//Repeat md5 string until none is found in database
	}
}	
}
?>

Link to comment
https://forums.phpfreaks.com/topic/175614-how-can-i-loop-this/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.