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 Releases
MercuryEmu Command.
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="Sledmore" data-source="post: 309133" data-attributes="member: 591"><p>Your problem there is that you'll only ever have one result. Also, you should check this line:</p><p>[PHP]id.addParameter("user", id);[/PHP]</p><p>You have no error because the addParameter void requires an object(which you passed through), but you never use the "user" parameter, and have no reason to do it like that.</p><p><strong></strong></p><p><strong>Here is a little advice:</strong></p><p>[PHP]</p><p>StringBuilder builder = new StringBuilder();</p><p>builder.Append("Hey, " + Session.GetHabbo().Username + " Here is a list of Twitch Streamers, it will be Very Apreciated if you Follow these :D.\n");</p><p>builder.Append("\n");</p><p>using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().getQueryreactor())</p><p>{</p><p> //I removed the `id` column as it seemed you didn't use it, maybe ORDER BY?</p><p> dbClient.setQuery("SELECT `username`,`twitch` FROM `twitch_users`");</p><p> DataTable GetStreamers = dbClient.getTable();//Fetch the streamers.</p><p></p><p> if (GetStreamers != null)//Check if there are any streamers.</p><p> {</p><p> foreach (DataRow Row in GetStreamers.Rows)//Iterate the rows, and append each streamer.</p><p> {</p><p> builder.Append("Streamer:\n");</p><p> builder.Append("Twitch Username: " + Row["Twitch"] + " Twitch Link = http://twitch.tv/ " + Row["Twitch"] + "\n");</p><p> builder.Append("in-game Username: " + Row["username"] + "\n");</p><p> builder.Append("\n");</p><p> }</p><p> }</p><p> else</p><p> {</p><p> //This would be a nice place to append a string saying there are no streamers.</p><p> }</p><p>}</p><p></p><p>builder.Append("Do you stream on twitch & want to show here? Contact Brad in-game.\n");</p><p>Session.SendNotifWithScroll(builder.ToString());[/PHP]</p><p></p><p>Good job though, and keep it up. <img src="/styles/default/xenforo/smilies/emojione/tongue.png" class="smilie" loading="lazy" alt=":p" title="Stick Out Tongue :p" data-shortname=":p" /></p></blockquote><p></p>
[QUOTE="Sledmore, post: 309133, member: 591"] Your problem there is that you'll only ever have one result. Also, you should check this line: [PHP]id.addParameter("user", id);[/PHP] You have no error because the addParameter void requires an object(which you passed through), but you never use the "user" parameter, and have no reason to do it like that. [B] Here is a little advice:[/B] [PHP] StringBuilder builder = new StringBuilder(); builder.Append("Hey, " + Session.GetHabbo().Username + " Here is a list of Twitch Streamers, it will be Very Apreciated if you Follow these :D.\n"); builder.Append("\n"); using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().getQueryreactor()) { //I removed the `id` column as it seemed you didn't use it, maybe ORDER BY? dbClient.setQuery("SELECT `username`,`twitch` FROM `twitch_users`"); DataTable GetStreamers = dbClient.getTable();//Fetch the streamers. if (GetStreamers != null)//Check if there are any streamers. { foreach (DataRow Row in GetStreamers.Rows)//Iterate the rows, and append each streamer. { builder.Append("Streamer:\n"); builder.Append("Twitch Username: " + Row["Twitch"] + " Twitch Link = http://twitch.tv/ " + Row["Twitch"] + "\n"); builder.Append("in-game Username: " + Row["username"] + "\n"); builder.Append("\n"); } } else { //This would be a nice place to append a string saying there are no streamers. } } builder.Append("Do you stream on twitch & want to show here? Contact Brad in-game.\n"); Session.SendNotifWithScroll(builder.ToString());[/PHP] Good job though, and keep it up. :P [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
MercuryEmu Command.
Top