[Include] oSQL - MySQL (v2)
#1

Hey,
So in short the day I worked more on Include , I added a few things , Haynklod tested , it works great , here are all the functions ,
Features :
PHP Code:
osql_CreateTable(handle,tablename[],data[]);osql_CreateLine(handle,tablename[],data[],values[]);
osql_DeleteTable (handletablename []);
osql_Load (dbhandletablename [], loadpublic []);
osql_SetInt (handletablename [], field [], value [], where [], towhere []);
osql_SetString (handletablename [], field [], & value [], where [], towhere []);
osql_SetFloat (handletablename [], field [], & Floatvalue [], where [], towhere []); 
A few concepts
varcahr - Necklaces
varcahr - Necklaces
int - integer,
float - float.
There are a few more , but these beauty samples .

PHP Code:
osql_CreateTable (handletablename [], data []); 
This function actually opens a new table, its parameters ,
handle - the variable which is compared to a database connection .
tablename - the table name opens .
data - which values ​​bring , including their type .
Example Usage -
PHP Code:
osql_CreateTable (Handle"oz""username varchar (40), password varchar (40), kills int, x float"); 
Basically we created a table named oz , with values
username - name of the player .
password - password.
kills - kills .
x - just location.

PHP Code:
osql_CreateLine (handletablename [], data [], values ​​[]) 
This is actually supposedly creates a new line institutionalized , its parameters ,
handle - the variable which is compared to a database connection .
tablename - the table name , where we will create a new line .
data - while the " keys " row.
values ​​- what was the value of the " keys " .
Example Usage -
PHP Code:
osql_CreateLine (Handle"oz""username, password, kills, x""'iRaiDeN', '123123 ', '2', '1 .1 '"); 
We have created a new line with the quota "is username & password & kills & x .
Enter the username key value - iRaiDeN .
Enter the password key value - 123123 .
Enter the key kills the value - 2 .
And key x income the value - 1.1 .

PHP Code:
osql_DeleteTable (handletablename []) 
This function is used to delete a table .
handle - the variable which is compared to a database connection .
tablename - which table to delete.
Example Usage -
PHP Code:
osql_DeleteTable (Handle"oz"); 
Actually here we deleted the table oz simple .

PHP Code:
osql_Load (handletablename [], loadpublic []) 
This function is very similar to the function of INI_ParseFile , but its parameters are different.
handle - the variable which is compared to a database connection .
tablename - which table limit pumping .
loadpublic - which it called Public ( Public obligated to create a parameter playerid ) .
Example Usage -
PHP Code:
new someString [128],
****
someInt ,
****
Float somePos ;
public 
OnPlayerConnect (playerid) return osql_Load (Handle"oz""loadPlayer");
forward loadPlayer (playerid);
public 
loadPlayer (playerid)
{
****
cache_get_field_content (0"password"someStringHandle128);
****
someInt cache_get_field_content_int (0"kills"Handle);
****
somePos cache_get_field_content_float (0"x"Handle);
****return 
;

Actually we took all the values ​​from the table oz variables , such simple.

PHP Code:
osql_SetInt (handletablename [], field [], value [], where [], towhere []) 
handle - the variable which is compared to a database connection .
tablename - where it will set the value , how a table .
field - what value to change.
value - what would the new value .
where & towhere - this will determine where the key where its value is equal to towhere .
Example Usage -
PHP Code:
osql_SetInt (Handle"oz""kills""20""username""iRaiDeN"); 
Basically we set the kills to 20 , where the key equal to iRaiDeN username .


PHP Code:
osql_SetString (handletablename [], field [], & value [], where [], towhere []) 
handle - the variable which is compared to a database connection .
tablename - where it will set the value , how a table .
field - what value to change.
value - what would the new value .
where & towhere - this will determine where the key where its value is equal to towhere .
Example Usage -
PHP Code:
osql_SetString (Handle"oz""password""oz1212""username""iRaiDeN"); 
Basically we set the key password the value oz1212 .

PHP Code:
osql_SetFloat (handletablename [], field [], & Floatvalue [], where [], towhere []) 
handle - the variable which is compared to a database connection .
tablename - where it will set the value , how a table .
field - what value to change.
value - what would the new value .
where & towhere - this will determine where the key where its value is equal to towhere .
Example Usage -
PHP Code:
osql_SetFloat (Handle"oz""x"2.2"username""iRaiDeN"); 
Basically we set the value 2.2 x key .

ChangeLog :
PHP Code:
Added another three functions
Bugs have been fixed 
Download.
View code.
** Please do not remark about SQL Injection, if someone can explain it for me to explain.
** Warning: Do not in this include Anti SQL Injection this.
Enjoy!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)