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
Requests
Revcms Faction Maker (FalloutRP) (NonHabbo)
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="IntactDev" data-source="post: 202046" data-attributes="member: 24757"><p><a href="http://devbest.com/members/leader.21320/" target="_blank">Leader</a>: This is the code that <a href="http://devbest.com/members/holmes.9520/" target="_blank">Holmes</a> made, but he put the incorrect table and column in the query.</p><p> </p><p>[PHP]<?php</p><p>$groupLimit = '5';</p><p>$queryGroupAmount = mysql_query("SELECT owner FROM factions WHERE id = '".$_SESSION['user']['id']."'");</p><p>$groupAmount = mysql_num_rows($queryGroupAmount);</p><p> </p><p>$neededCredits = '500';</p><p>$queryCreditAmount = mysql_query("SELECT credits FROM users WHERE id = '".$_SESSION['user']['id']."'");</p><p>$creditAmount = mysql_result($queryCreditAmount, 0);</p><p> </p><p>if ($groupAmount >= $groupLimit)</p><p>{</p><p> if ($creditAmount >= $neededCredits)</p><p> {</p><p> if (isset($_POST['create']))</p><p> {</p><p> $newCreditAmount = $creditAmount - 500;</p><p> mysql_query("INSERT INTO factions(name,owner,official) VALUES('".filter($_POST['name'])."', '".$_SESSION['user']['id']."', '0')");</p><p> mysql_query("UPDATE users SET credits= '".$newCreditAmount."' WHERE id = '".$_SESSION['user']['id']."' ");</p><p> echo 'Faction has been created!';</p><p> }</p><p> }</p><p> else</p><p> {</p><p> $leftCredits = $neededCredits - $creditAmount;</p><p> echo 'You don\'t have enough credits! You atleast need '.$neededCredits.' to create a group. You currently have '.$creditAmount.' credits, that means you still need '.$leftCredits.' credits to create a group.';</p><p> }</p><p>}</p><p>else</p><p>{</p><p> echo 'You already have more then '.$groupLimit.' groups! This means you can not make any more.';</p><p>}</p><p>?> [/PHP]</p></blockquote><p></p>
[QUOTE="IntactDev, post: 202046, member: 24757"] [URL='http://devbest.com/members/leader.21320/']Leader[/URL]: This is the code that [URL='http://devbest.com/members/holmes.9520/']Holmes[/URL] made, but he put the incorrect table and column in the query. [PHP]<?php $groupLimit = '5'; $queryGroupAmount = mysql_query("SELECT owner FROM factions WHERE id = '".$_SESSION['user']['id']."'"); $groupAmount = mysql_num_rows($queryGroupAmount); $neededCredits = '500'; $queryCreditAmount = mysql_query("SELECT credits FROM users WHERE id = '".$_SESSION['user']['id']."'"); $creditAmount = mysql_result($queryCreditAmount, 0); if ($groupAmount >= $groupLimit) { if ($creditAmount >= $neededCredits) { if (isset($_POST['create'])) { $newCreditAmount = $creditAmount - 500; mysql_query("INSERT INTO factions(name,owner,official) VALUES('".filter($_POST['name'])."', '".$_SESSION['user']['id']."', '0')"); mysql_query("UPDATE users SET credits= '".$newCreditAmount."' WHERE id = '".$_SESSION['user']['id']."' "); echo 'Faction has been created!'; } } else { $leftCredits = $neededCredits - $creditAmount; echo 'You don\'t have enough credits! You atleast need '.$neededCredits.' to create a group. You currently have '.$creditAmount.' credits, that means you still need '.$leftCredits.' credits to create a group.'; } } else { echo 'You already have more then '.$groupLimit.' groups! This means you can not make any more.'; } ?> [/PHP] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Requests
Revcms Faction Maker (FalloutRP) (NonHabbo)
Top