Joseph Witchard
03-07-2010, 07:26 AM
http://www.hogwarts-rpg.net/forum/testvb/faq.php?faq=vb3_board_usage#faq_vb3_forums_threads _posts
That's where the problem is. The username and password to get into my test forum is testuser and hElpmE, respectively.
My code:
$my_conn = new mysqli('my_login_credentials');
$my_conn_query = "SELECT gryffindor, slytherin FROM hpoints LIMIT 1";
$my_stmt = $my_conn->prepare($my_conn_query);
$my_stmt->execute();
$my_stmt->bind_result($my_g, $my_s);
$my_stmt->fetch();
echo "<div style=\"background-color: black; color: #FFFFFF; width: 100px; height: 100px;\">$my_g<br/>$my_s</div>";
$my_conn->close();
This is the code for the plugin (I'm pretty sure the hookname was something like faq_item_display). I'm not trying to accomplish anything with this, I'm just trying to learn how vBulletin plugins work by trying out things. And, as a lot of web development learning is trial and error, I've run into the first thing I don't understand, so I'm ready to get that out of the way and move on. The table (hpoints) contains two INT fields: one with 50, and one with 55. Then I display it on a black div once it's retrieved from the database. I don't really understand why it's displaying over and over again on the above page, so could someone explain why it's doing that and what I would need to do to get it to just get it to display each number once?
Please go easy on me. Like I said, this is my first attempt to interact with vBulletin. The code above is worthless; I'm only using it for testing purposes. Thanks!
That's where the problem is. The username and password to get into my test forum is testuser and hElpmE, respectively.
My code:
$my_conn = new mysqli('my_login_credentials');
$my_conn_query = "SELECT gryffindor, slytherin FROM hpoints LIMIT 1";
$my_stmt = $my_conn->prepare($my_conn_query);
$my_stmt->execute();
$my_stmt->bind_result($my_g, $my_s);
$my_stmt->fetch();
echo "<div style=\"background-color: black; color: #FFFFFF; width: 100px; height: 100px;\">$my_g<br/>$my_s</div>";
$my_conn->close();
This is the code for the plugin (I'm pretty sure the hookname was something like faq_item_display). I'm not trying to accomplish anything with this, I'm just trying to learn how vBulletin plugins work by trying out things. And, as a lot of web development learning is trial and error, I've run into the first thing I don't understand, so I'm ready to get that out of the way and move on. The table (hpoints) contains two INT fields: one with 50, and one with 55. Then I display it on a black div once it's retrieved from the database. I don't really understand why it's displaying over and over again on the above page, so could someone explain why it's doing that and what I would need to do to get it to just get it to display each number once?
Please go easy on me. Like I said, this is my first attempt to interact with vBulletin. The code above is worthless; I'm only using it for testing purposes. Thanks!