I can't figure out why this function keeps coming up blank any suggestions would be appreciated I think it's pretty easy to tell what I'm trying to do with this function.
function productCode($maxCode, $database_trustinme, $trustinme){
//Creates possible's variables to be used with the product code.
$codepossible = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
$code_max = count($code_possible);
for($ione=0; $ione == 1; $ione++){
for($i=0; $i == $maxCode; $i++){
$prod = rand(1, $codepossible);
$productCodearray[$i] = $codepossible[$prod];
}
$productCode = implode(",", $productCodearray);
$selectSQL = "SELECT * FROM category WHERE productCode = '$productCode'";
mysql_select_db($database_trustinme, $trustinme);
$Result1 = mysql_query($selectSQL, $trustinme) or die(mysql_error());
if(mysql_num_rows($Result1) >= 1){
$ione = 0;
}
}
session_start();
$_SESSION["productCode"] = $productCode;
}
Any help is greatly appreciated thank you.