CMS/Standalone List Characters created by user. (PHP)

Results 1 to 3 of 3
  1. #1
    This is bullshit. alextepes is offline
    MemberRank
    Sep 2006 Join Date
    CanadaLocation
    310Posts

    CMS/Standalone List Characters created by user. (PHP)

    Some CMS systems I've looked at have no way of seeing their characters through the web UI, and that's what I'm working on right now. Using the SRO_VT_SHARD stored procedure I was able to list all characters owned by the logged in user.

    Standalone:
    Spoiler:

    Code:
      <?phpif (isset($_POST['submit'])) {
        $serverIp     = "192.168.2.2";
        $userName     = "sa";
        $password     = "password";
        $dbName      = "SRO_VT_SHARD";
    $dbConn = mssql_connect($serverIp, $userName, $password) or die ("Couldn't connect to server $serverIp");
    
    
    $user = htmlspecialchars($_POST['user'], ENT_QUOTES);
                    echo 'Character list for "' . $user . '"<br>';
    //Get CL.
    mssql_select_db($dbName, $dbConn) or die ("Couln't select database $dbName");
    // Create a new statement
    $stmt = mssql_init('_QueryUserCharByUserID');
    
    
    // Bind values
    mssql_bind($stmt, '@AccountName',    $user,  SQLVARCHAR,     false,  false,   60);
    // Execute the statement
    $q = mssql_execute($stmt);
    if ($row = @mssql_fetch_row($q)) {
    do {
    echo $row[1] . '<br>';
    } while($row = @mssql_fetch_row($q));
    } else echo 'No results';
    mssql_free_statement($stmt);
    }
    ?>
    <form action="#" method="post">
    Username: <input type="text" name="user"><br>
    <input type="submit" name="submit" value="List characters!">
    </form>
    Last edited by alextepes; 26-11-13 at 10:03 PM. Reason: More verbose/user friendly. And a bug.


  2. #2
    Proficient Member Royalblade is offline
    MemberRank
    Jan 2013 Join Date
    167Posts

    Re: CMS/Standalone List Characters created by user. (PHP)

    Why does ragezone not have dislike or faceplam icon -.-"

    Cant even facepalm at that script properly.
    It's nice that you were able to "find" (do i even say find in this situation or rather say, you 'SAW') the procedure.

    Even without it, its just a join of tables.

  3. #3
    This is bullshit. alextepes is offline
    MemberRank
    Sep 2006 Join Date
    CanadaLocation
    310Posts

    Re: CMS/Standalone List Characters created by user. (PHP)

    So you're getting upset I efficiently made a mssql DB call to fetch all characters made by a user? Most people don't know PHP, period. So, your comment here seems unneeded, and you have an ego problem, surely. I've been a web developer/PC tech for 8 years+, and people who complain about crap that's free aren't worth a grain of salt.

    You must have better things to do than to put down free help, just because YOU know what a stored procedure does or how to code it, right?

    The only reason I put this here was I thought it might be useful to someone, as it's just a piece of code I used to improve a CMS system, so that I could list, then go to character views, because I am adding features like changing your region/teleport locations through a website, and GM functions to modify users. A person could take this and build what I am.


    Case in point:
    cmsmod3.png

    cmsmod.png

    cmsmod2.png

    cmsmod4.png

    Little pieces of code can evolve.

    I'm disappointed there isn't a face palm or dislike for stupid egotistical comments from people who lack imagination. And you know something? You make posts like this, too. Either releasing modded databases, or adding items to all users that could seem useless to me or anyone, but I don't jump on you or bring down your posts. Making mssql queries and actually making queries for PHP are two separate entities. You should see that you're in above your head on the subject and leave well enough alone. Also, I'm pretty sure RZ is the kind of community that appreciates anything the community gives, so long as it's useful to someone and it actually works. I mean, MentaL is constantly giving stuff out to people, or people just to release guides. We should be impartial to what we see on the forums as useful or not. I mean. I seen a LoL themed launcher the other day, and I wanted to post "Wtf is this nonsense?" but I didn't, because this is community, not a pissing contest.
    Last edited by alextepes; 27-11-13 at 12:53 PM.



Advertisement