Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
[PHP] Loop until false
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="NSA" data-source="post: 214839" data-attributes="member: 10034"><p>So here's what I currently have for generating a new identity.</p><p> </p><p>[CODE]public function createIdentity()</p><p> {</p><p> global $con;</p><p> function getIdentity($identity)</p><p> {</p><p> global $con;</p><p> $q = "SELECT * FROM identities WHERE identity = '{$identity}'";</p><p> if(!$result = $con->query($q))</p><p> {</p><p> die("Could not execute query.");</p><p> }</p><p> $count = $result->num_rows;</p><p> if($count > 0)</p><p> {</p><p> return true;</p><p> }</p><p> else</p><p> {</p><p> return false;</p><p> }</p><p> }</p><p> $check = getIdentity($this->generateIdentity());</p><p> }[/CODE]</p></blockquote><p></p>
[QUOTE="NSA, post: 214839, member: 10034"] So here's what I currently have for generating a new identity. [CODE]public function createIdentity() { global $con; function getIdentity($identity) { global $con; $q = "SELECT * FROM identities WHERE identity = '{$identity}'"; if(!$result = $con->query($q)) { die("Could not execute query."); } $count = $result->num_rows; if($count > 0) { return true; } else { return false; } } $check = getIdentity($this->generateIdentity()); }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
[PHP] Loop until false
Top