MySQL Tables Help

Started by EightyVice, Jun 16, 2017, 10:53 AM

Previous topic - Next topic

EightyVice

Well , i didnt do any server with database before
what i know just how to connect
how to add values to columns and rows  and tables and so on and how get values from it
i didnt find that on wiki or i didnt understand the wikis :v
Thanks

Xmair


Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Mötley

It takes patience, Your answers wont just jump out in front of you with a snap of a finger.

Hear is some really old documentation that I really find useful http://www.tizag.com/sqlTutorial/

And also don't just forcibly switch how you store data, Your going to end up with a F'D up script possibly, Do your homework/studies first :)

EightyVice

Quote from: TurboGrafx on Jun 16, 2017, 11:37 AMIt takes patience, Your answers wont just jump out in front of you with a snap of a finger.

Hear is some really old documentation that I really find useful http://www.tizag.com/sqlTutorial/

And also don't just forcibly switch how you store data, Your going to end up with a F'D up script possibly, Do your homework/studies first :)
Thanks but what i want is how to add value to SQL database by squrriel :D

Mötley

#4
Your best bet is to study SQL, Once you understand SQL you will be able to imply it to squirrel yourself.

http://www.tizag.com/sqlTutorial/sqlinsert.php

There is so much to help you there, Once you read and understand feel free to ask for coding help :)

But until then we can not do your accounts for you

All of this is documented learning material on that site
QuoteSQL Tutorial
SQL - Introduction
SQL - Databases
SQL - Tables
SQL - Queries
SQL - Select
SQL - Where
SQL - As
SQL - Operators
SQL - Create
SQL - Insert
SQL - And / Or
SQL - Between
SQL - Order By
SQL - Update
SQL - Alter
SQL - Distinct
SQL - Subqueries
SQL - Join
SQL - In
SQL - Case
SQL - Group By
SQL - Views
SQL - Dates
SQL - Datepart
SQL - Dateadd
SQL - Delete
SQL - Union
SQL - Syntax
SQL - Data Types
SQL - Expressions
Conceptual SQL
SQL - History
SQL - Platforms
SQL - Commands
SQL - Structure
SQL - Predicates
SQL - Identifiers
Get Help!
SQL Forum

EightyVice

Quote from: TurboGrafx on Jun 17, 2017, 01:23 AMYour best bet is to study SQL, Once you understand SQL you will be able to imply it to squirrel yourself.

http://www.tizag.com/sqlTutorial/sqlinsert.php

There is so much to help you there, Once you read and understand feel free to ask for coding help :)

But until then we can not do your accounts for you

All of this is documented learning material on that site
QuoteSQL Tutorial
SQL - Introduction
SQL - Databases
SQL - Tables
SQL - Queries
SQL - Select
SQL - Where
SQL - As
SQL - Operators
SQL - Create
SQL - Insert
SQL - And / Or
SQL - Between
SQL - Order By
SQL - Update
SQL - Alter
SQL - Distinct
SQL - Subqueries
SQL - Join
SQL - In
SQL - Case
SQL - Group By
SQL - Views
SQL - Dates
SQL - Datepart
SQL - Dateadd
SQL - Delete
SQL - Union
SQL - Syntax
SQL - Data Types
SQL - Expressions
Conceptual SQL
SQL - History
SQL - Platforms
SQL - Commands
SQL - Structure
SQL - Predicates
SQL - Identifiers
Get Help!
SQL Forum
i know SQL but i dont know how to use it in Squrriel in vcmp , there is not any select * from and so on

Xmair

#6
The function is QuerySQL( yourDB, query );

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

KAKAN

Quote from: Zeyad Ahmed on Jun 17, 2017, 03:36 AMi know SQL but i dont know how to use it in Squrriel in vcmp , there is not any select * from and so on
Dafuq you talking about?
oh no

EightyVice

Quote from: KAKAN on Jun 17, 2017, 08:04 AM
Quote from: Zeyad Ahmed on Jun 17, 2017, 03:36 AMi know SQL but i dont know how to use it in Squrriel in vcmp , there is not any select * from and so on
Dafuq you talking about?
let me explain it for you :v
if we have db with name Name and the username is user and password is pass and there is a table called players and a column for kills stats
how can i get the value from it and set the value? :v

EK.IceFlake

Quote from: Zeyad Ahmed on Jun 17, 2017, 09:06 AM
Quote from: KAKAN on Jun 17, 2017, 08:04 AM
Quote from: Zeyad Ahmed on Jun 17, 2017, 03:36 AMi know SQL but i dont know how to use it in Squrriel in vcmp , there is not any select * from and so on
Dafuq you talking about?
let me explain it for you :v
if we have db with name Name and the username is user and password is pass and there is a table called players and a column for kills stats
how can i get the value from it and set the value? :v
By doing transactions on it

KAKAN

Quote from: Zeyad Ahmed on Jun 17, 2017, 09:06 AM
Quote from: KAKAN on Jun 17, 2017, 08:04 AM
Quote from: Zeyad Ahmed on Jun 17, 2017, 03:36 AMi know SQL but i dont know how to use it in Squrriel in vcmp , there is not any select * from and so on
Dafuq you talking about?
let me explain it for you :v
if we have db with name Name and the username is user and password is pass and there is a table called players and a column for kills stats
how can i get the value from it and set the value? :v
I don't know what's so hard to not understand in the "wiki"
mysql_connect( "localhost", "user", "pass", "name" ); will establish the connection.
this is the code:-
myDB <- mysql_connect( "localhost", "user", "pass", "name" );
local data, query = mysql_query( myDB, "SELECT * FROM Players");
while( data = mysql_fetch_assoc( query ) )
 print( data["Kills"] ); //or whatever
mysql_free_result( query ); //cause you sux.
mysql_query( myDB, "UPDATE Players SET Kills=-1 WHERE Name='Zeyad_Ahmed' );
I simply do not use SQL much, so, it might be wrong.
oh no

Mötley

#11

@Zeyad Ahmed, Firstly I haven't had time to play with these accounts. So don't expect anything pretty.

But once I call upon the class, The values from the database will transfer to my class. That's it...

pretty sure thats what you are talking about

Sorry I could go into this better, But I feel strange explaining it
class Registration
{
     Name = null; // The players name
     Password = null; //The players password

     Joins = 0; // Amount of times the player joined the server, Login count
     PreviousData = false; // Logged

     /* A bool if the player is admin, if admin after login, It will call for the admin class as well admin db */
     Admin = null;

     constructor(player, PassDB)
     {
       /* Store the players name */
       
       Name = player.Name;

       local query = ::QuerySQL( PassDB, "SELECT * FROM Passwords WHERE Name='" +  Name + "'" );
       
       /* Set da playa as a Guest */
       player.Name = "Guest[" + player.ID + "]"; //Player is a guest
       
       Password = ::GetSQLColumnData( query, 1 );
       Joins = ::GetSQLColumnData( query, 2 );
       
        /* Even though we set the bool, it doesnt do a check/class set until the player has logged in */
        Admin = ::GetSQLColumnData( query, 3 );

       ::FreeSQLQuery( query );
     }


EightyVice

Thanks KAKAN and TurboGrafx
That what i needed :v