Jump to content

FewFlyBy

New Members
  • Posts

    1
  • Joined

  • Last visited

FewFlyBy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello so I have a simple code here that will check if a random number already exists in the database and will generate a new one: $rand = mt_rand(100000, 999999); $sid = array( ":sponsorID" => $rand ); $accounts = $db->select("accounts", "sponsorID = :sponsorID", $sid) while(count($accounts) > 0) { $newNum = mt_rand(100000, 999999); } What I wanted to do is to echo out $newNum. When I echo it out I get undefined index of that variable. How can I solve this?
×
×
  • 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.