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
Server Development
Habbo Retros
Habbo Q&A
[PHP Help] Checking for a username in the database
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="JoshuaLuke" data-source="post: 112331" data-attributes="member: 12258"><p>Hey there developers,</p><p> </p><p>I'm creating a referal system for my CMS (Uber) and i'm wanting it to throw an error if the value inputted in a text box isn't a username in the database, heres my code:</p><p> </p><p>[CODE]</p><p> </p><p> </p><p>$checkRef = (mysql_result(mysql_query("SELECT `username` FROM `users` WHERE `username` = '".$referal."'"), 0));</p><p> </p><p>if($checkRef < '1') {</p><p>echo 'Error';</p><p>}</p><p>[/CODE]</p><p>But I have 2 problems, this happens:</p><p><img src="http://i.imgur.com/Tuf5R.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>That happens when a user goes onto the page, I need it to happen after the submit.</p><p>Also, I don't want the form to submit if the $checkRef is 0. How do I do this?</p></blockquote><p></p>
[QUOTE="JoshuaLuke, post: 112331, member: 12258"] Hey there developers, I'm creating a referal system for my CMS (Uber) and i'm wanting it to throw an error if the value inputted in a text box isn't a username in the database, heres my code: [CODE] $checkRef = (mysql_result(mysql_query("SELECT `username` FROM `users` WHERE `username` = '".$referal."'"), 0)); if($checkRef < '1') { echo 'Error'; } [/CODE] But I have 2 problems, this happens: [IMG]http://i.imgur.com/Tuf5R.png[/IMG] That happens when a user goes onto the page, I need it to happen after the submit. Also, I don't want the form to submit if the $checkRef is 0. How do I do this? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
[PHP Help] Checking for a username in the database
Top