Register for your free account! | Forgot your password?

You last visited: Today at 13:51

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[PHP] SQL Klasse

Discussion on [PHP] SQL Klasse within the Flyff PServer Guides & Releases forum part of the Flyff Private Server category.

Reply
 
Old   #1



 
Sedrika's Avatar
 
elite*gold: 18
The Black Market: 103/0/0
Join Date: Sep 2009
Posts: 20,174
Received Thanks: 14,475
[PHP] SQL Klasse

.
Sedrika is offline  
Thanks
3 Users
Old 03/18/2014, 05:52   #2
 
Supr3matt's Avatar
 
elite*gold: 80
Join Date: May 2013
Posts: 146
Received Thanks: 23
Thanks, it is very helpful
Supr3matt is offline  
Old 03/24/2014, 11:06   #3



 
Sedrika's Avatar
 
elite*gold: 18
The Black Market: 103/0/0
Join Date: Sep 2009
Posts: 20,174
Received Thanks: 14,475
Is anyone using this class?
Sedrika is offline  
Old 03/24/2014, 12:26   #4
 
elite*gold: 0
Join Date: Oct 2012
Posts: 948
Received Thanks: 157
Its an nice class but i have my own class that doesnt relay on ODBC.

But its an good job. I wish i could see more of OOP.

I am currently working an an flyff website thats based on OOP.
raventh1984 is offline  
Old 03/24/2014, 13:34   #5



 
Sedrika's Avatar
 
elite*gold: 18
The Black Market: 103/0/0
Join Date: Sep 2009
Posts: 20,174
Received Thanks: 14,475
There are both scripts. One for mssql connection and one for odbc.
Sedrika is offline  
Old 03/24/2014, 13:47   #6
 
elite*gold: 0
Join Date: Oct 2012
Posts: 948
Received Thanks: 157
o.O didnt say the first one.

haha ok

Here i am using this one. its MSSQL

PHP Code:
<?php
class MSSQL
{
    private 
$_link;

    public function 
connect($server=''$username=''$password=''$new_link=true)
    {
        
$this->_link mssql_connect($server$username$password$new_link);
    }
    
    public function 
Escape($string)
    {
        return 
str_replace("'""''"$string);
    }
    
     public function 
query($query) {
        return 
mssql_query($query$this->_link);  
    }
    
    public function 
fetchArray($result$array_type MYSQL_BOTH) {
        return 
mssql_fetch_array($result$array_type);  
    }
    
    public function 
fetchRow($result) {
        return 
mssql_fetch_row($result);  
    }
    
    public function 
fetchAssoc($result) {
        return 
mssql_fetch_assoc($result);
    }
    
    public function 
fetchObject($result) {
        return 
mssql_fetch_object($result);  
    }
    
    public function 
numRows($result) {
        return 
mssql_num_rows($result);
    }
    
    public function 
close() {
        return 
mssql_close($this->_link);
    }
}

//Example
//Select DB
$db->query('USE ACCOUNT_DBF');
//Getting data
$result $db->query('SELECT account,password FROM ACCOUNT_TBL WHERE account = "accountname"');
//Fetching the data
echo $db->fetchAssoc($result);

?>
raventh1984 is offline  
Old 03/24/2014, 14:35   #7



 
Sedrika's Avatar
 
elite*gold: 18
The Black Market: 103/0/0
Join Date: Sep 2009
Posts: 20,174
Received Thanks: 14,475
Use at least my escape function it's way better then yours
Sedrika is offline  
Thanks
1 User
Old 03/24/2014, 15:17   #8
 
elite*gold: 0
Join Date: Dec 2012
Posts: 33
Received Thanks: 14
@raventh1984 that's a really poor class. Use at least prepared statements as in Sedrika script.
I've somewhere a SQL class I don't use since a long time ago, I will post if I find it.
DarkFlyffTeam is offline  
Old 03/24/2014, 15:24   #9
 
elite*gold: 0
Join Date: Oct 2012
Posts: 948
Received Thanks: 157
Thanks for the comment DarkFlyff
I will take an look into prepared statements.
raventh1984 is offline  
Reply


Similar Threads Similar Threads
Biete Mathehilfe bis zur 10. Klasse Real/ 9.Klasse Haupt
03/13/2012 - School & Education - 0 Replies
Wenn ihr Probleme mit einer aufgabe habt, schickt mir eine PM. Kostet nur 1eGold. Vielleicht auch nichts :D Kommt ganz auf die aufgaben drauf an.
Volkswechsel alte Klasse(Classic)->neue Klasse(Cata)
01/30/2011 - World of Warcraft - 13 Replies
Hi, Ich würde meinen Untoten Magier gerne zu einem Goblin Magier verändern. Ich weis auch, dass Goblins Magier sein können aber ich finde keine 100% sicheren Infos ob man auch Untoter->Goblin changen kann! Kennt sich da einer aus? Außerdem wird ja der Ruf der alten Heimatstadt auf die neue gewechselt, also sollte in meinem Fall doch nur von Unterstadt->Goblinstadt geändert werden oder? Was ist das langsame Goblinreittier(60%) und was das Schnelle(100%) zu dem meine Skelettpferde...
[C++]Funktion einer Klasse in einer anderen Funktion der Klasse verwenden, aber wie?
07/25/2010 - C/C++ - 3 Replies
Mein Problem ist eigentlich recht simpel und die Lösung wahrscheinlich auch. Da ich bisher fast 0 mit Klassen am Hut hatte, wollte ich mich doch mit dem Thema anfreunden und hatte gleich angefangen: int test::Funktion2() { int temp; cin>>temp; return temp; }
Welche Klasse ist die Beste Klasse
07/06/2010 - Metin2 - 6 Replies
Hallo ich habe heute mal angefangen Metin 2 angefangen und wollte fragen welche klasse ist die beste meine Vorstellung Menge Deff Wird Mich freuen auf Antwort



All times are GMT +1. The time now is 13:51.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.