Vice City: Multiplayer

VC:MP Discussion => General Discussion => Topic started by: KAKAN on Aug 17, 2015, 02:44 PM

Title: With MySQL
Post by: KAKAN on Aug 17, 2015, 02:44 PM
Can anybody be good and post all the work of MySQL?
I mean all the functions and what does it do and its syntax
Title: Re: With MySQL
Post by: KAKAN on Aug 17, 2015, 02:52 PM
And most important:
Tell me how to create a table/database using MySQL, like we use QuerySQL, like that, how to use it in MySQL
Title: Re: With MySQL
Post by: MatheuS on Aug 17, 2015, 03:38 PM
MySQL functions

these are the functions:

mysql_connect( szHost, szUsername, szPassword, szDatabase, iPort )
mysql_close( pConnection )
mysql_query( pConnection, szQuery )
mysql_num_rows( pResult )
mysql_num_fields( pResult )
mysql_fetch_row( pResult )
mysql_fetch_assoc( pResult )
mysql_fetch_lengths( pResult )
mysql_free_result( pResult )
mysql_errno( pConnection )
mysql_error( pConnection )
mysql_ping( pConnection )
mysql_escape_string( pConnection, szString )
mysql_select_db( pConnection, szDatabase )
mysql_change_user( pConnection, szUser, szPassword )
mysql_warning_count( pConnection )
mysql_affected_rows( pConnection )
mysql_insert_id( pConnection )
mysql_info( pConnection )
Title: Re: With MySQL
Post by: . on Aug 17, 2015, 03:42 PM
Have you looked in the tutorials (http://forum.vc-mp.org/index.php?board=9.0) section? Have you googled (http://lmgtfy.com/?q=mysql+free+video+tutorials)? Have you looked at any documentation (https://dev.mysql.com/usingmysql/get_started.html)? What makes you think that our tutorials will be any different than the existing ones (http://freevideolectures.com/Course/3179/MySQL-Database)?

No offense but you know what's my advice to any programmer that can't document on his own? Go find another hobby!
Title: Re: With MySQL
Post by: KAKAN on Aug 17, 2015, 04:57 PM
SO
mysql_query( pConnection, szQuery )This is used to create database right?
Title: Re: With MySQL
Post by: Thijn on Aug 17, 2015, 06:13 PM
That's used to execute a query. If that query makes a table, yes.
A database should already exist, since you'd need that in the connect statement.
Title: Re: With MySQL
Post by: KAKAN on Aug 18, 2015, 08:40 AM
if the database doesn't exist, then??
Title: Re: With MySQL
Post by: KAKAN on Aug 18, 2015, 08:44 AM
and can u update the wiki?
I can get much info from there
I want SQL and MySQL in wiki, can anybody update it?
Title: Re: With MySQL
Post by: DizzasTeR on Aug 18, 2015, 09:07 AM
I'll suggest you to stick with SQLite, you can't manage MySQL.
Title: Re: With MySQL
Post by: FinchDon on Aug 18, 2015, 09:46 AM
Doom is right Mysql is not kinda easy its very difficult to know it better use Sqlite
Title: Re: With MySQL
Post by: KAKAN on Aug 18, 2015, 02:12 PM
Quote from: KAKAN on Aug 18, 2015, 08:40 AMif the database doesn't exist, then??


Can't u just answer me?
And @FinchDon plz don't post on it, until unless u have something to tell
Title: Re: With MySQL
Post by: DizzasTeR on Aug 18, 2015, 02:26 PM
What do you expect SQLite to do when you don't have your so called "db" defined and you try to call it in QuerySQL... If you don't understand this then I guess its pointless to help onward.
Title: Re: With MySQL
Post by: Thijn on Aug 18, 2015, 03:50 PM
Quote from: Doom_Killer on Aug 18, 2015, 02:26 PMWhat do you expect SQLite to do when you don't have your so called "db" defined and you try to call it in QuerySQL... If you don't understand this then I guess its pointless to help onward.
He's talking about MySQL, not SQLite. And he's talking about an actual database, not the db variable that will hold the pointer.



If you don't know how to create a mysql database you're better off using SQLite.
Title: Re: With MySQL
Post by: KAKAN on Aug 18, 2015, 04:03 PM
Yus, idk how to create a MySQL database, and i want to learn it.
Title: Re: With MySQL
Post by: DizzasTeR on Aug 18, 2015, 04:39 PM
Quote from: Thijn on Aug 18, 2015, 03:50 PM
Quote from: Doom_Killer on Aug 18, 2015, 02:26 PMWhat do you expect SQLite to do when you don't have your so called "db" defined and you try to call it in QuerySQL... If you don't understand this then I guess its pointless to help onward.
He's talking about MySQL, not SQLite. And he's talking about an actual database, not the db variable that will hold the pointer.



If you don't know how to create a mysql database you're better off using SQLite.

I'm talking about SQLite because MySQL is almost same, so that's a stupid question that what will happen when there is no database at all...

Since he used SQLite before I'm trying to maake him realize that its not that different.
Title: Re: With MySQL
Post by: Thijn on Aug 18, 2015, 04:44 PM
Quote from: Doom_Killer on Aug 18, 2015, 04:39 PM
Quote from: Thijn on Aug 18, 2015, 03:50 PM
Quote from: Doom_Killer on Aug 18, 2015, 02:26 PMWhat do you expect SQLite to do when you don't have your so called "db" defined and you try to call it in QuerySQL... If you don't understand this then I guess its pointless to help onward.
He's talking about MySQL, not SQLite. And he's talking about an actual database, not the db variable that will hold the pointer.



If you don't know how to create a mysql database you're better off using SQLite.

I'm talking about SQLite because MySQL is almost same, so that's a stupid question that what will happen when there is no database at all...

Since he used SQLite before I'm trying to maake him realize that its not that different.
There's a big difference since SQLite will create the database if it doesn't exist and mysql will not. Which is why KAKAN is struggling.



Quote from: KAKAN on Aug 18, 2015, 04:03 PMYus, idk how to create a MySQL database, and i want to learn it.
Where do you host your MySQL server. It should have something called PhpMyAdmin. Login using that, then create a new database and user.
I usually create an user, and select I want to create a database with the same name. That way you don't have to fiddle with permissions.
Title: Re: With MySQL
Post by: KAKAN on Aug 18, 2015, 04:54 PM
Okay, I'll try it
Title: Re: With MySQL
Post by: DizzasTeR on Aug 18, 2015, 05:38 PM
I was talking about the functions, but anyway, Kakan you have to setup things, create a user, setup database and then connect it. Seems hard, but it isn't.
Title: Re: With MySQL
Post by: KAKAN on Aug 19, 2015, 09:08 AM
Tried and it worked, Thanks @Thijn nd @Doom_Killer for ur help