// Create a options of login and reconect of db
// new handle;
// new rows, fields;
// new temp[256];
// Create public function of pawn
stock MySQLConnect()
{
mysql_connect(s_host, s_user, s_db, s_pass);
if(mysql_errno(1) == 0)
{
printf("MySQL: Connections to database (%s) was established !", s_db);
}
else
{
printf("MySQL: Connections to database (%s) failed !", s_db);
}
return 1;
}
// How to use
native MySQLConnect();[/pawn] Imagini / Video (optional): - Aţi încercat să rezolvaţi singur?: Da, cand il scot imi merge :-?
"Mulţi programatori buni fac programare nu pentru că se aşteaptă să câştige bani sau să fie lăudaţi de public, ci pentru că e amuzant să programezi." - Linus Torvalds
Question
Stark.sys
Problemă întâlnită (descriere): Am facut un include pentru conectiunea cu baza de date mysql si cand il adaug imi da Run time error 19.
Ero(area / rile) / warning-(ul / urile): Run time error 19
Liniile de cod / sursa / script-ul: [pawn]/*
* SA-MP MySQL Connect client for pawn
*
* © Copyright 2014, sRk7
*
*/
#include
// Define host connections.
#define s_host "127.0.0.1" // or localhost
#define s_user "root"
#define s_pass "" // No pass resquest
#define s_db "sdb"
// Create a options of login and reconect of db
// new handle;
// new rows, fields;
// new temp[256];
// Create public function of pawn
stock MySQLConnect()
{
mysql_connect(s_host, s_user, s_db, s_pass);
if(mysql_errno(1) == 0)
{
printf("MySQL: Connections to database (%s) was established !", s_db);
}
else
{
printf("MySQL: Connections to database (%s) failed !", s_db);
}
return 1;
}
// How to use
native MySQLConnect();[/pawn]
Imagini / Video (optional): -
Aţi încercat să rezolvaţi singur?: Da, cand il scot imi merge :-?
"Mulţi programatori buni fac programare nu pentru că se aşteaptă să câştige bani sau să fie lăudaţi de public, ci pentru că e amuzant să programezi." - Linus Torvalds
Link to comment
Share on other sites
6 answers to this question
Recommended Posts