SA-MP Forums Archive
Help Mysql Table?[+REP] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help Mysql Table?[+REP] (/showthread.php?tid=521705)



Help Mysql Table?[+REP] - PAF - 24.06.2014

mysql_query("CREATE TABLE IF NOT EXISTS `Bans`(`id` int(10) NOT NULL auto_increment PRIMARY KEY, `Nick` varchar(25) NOT NULL, `UserIP` varchar(30) NOT NULL, `Admin` varchar(25) NOT NULL, `Time` varchar(30) NOT NULL, `Hours` int(10) NOT NULL, `Reason` varchar(12 NOT NULL, `Unix` int(56) NOT NULL default '0')");

This table created but not saving in phpmyadmin help


Re : Help Mysql Table?[+REP] - S4t3K - 24.06.2014

Do you ever use an "INSERT" query ?

Because if the table is empty, it's perfectly normal and it means that you've never inserted data inside through "INSERT INTO"


Re: Help Mysql Table?[+REP] - PAF - 24.06.2014

i inserted


Re: Help Mysql Table?[+REP] - PAF - 24.06.2014

format(query, sizeof(query), "INSERT INTO `Bans` (`Nick`, `UserIP`, `Admin`, `Time`, `Reason`, `Unix`) VALUES('%s', '%s', '%s', '%s', '%d/%d/%d %d:%d:%d', '%d', '%d', '%d', '%s', '%d')", receivername, receiverip, sendername, dayss, monthss, yearss, hourss, minutess, secondss, reason, 999999999999999999999999);


Re : Help Mysql Table?[+REP] - S4t3K - 24.06.2014

You have specified 6 fields to fill but you have put 10 values.
Either delete the field specification or delete some values to insert.


Re: Help Mysql Table?[+REP] - PAF - 24.06.2014

please tell me you skype name!


Re : Help Mysql Table?[+REP] - S4t3K - 24.06.2014

No.
Read my signature.


Re: Help Mysql Table?[+REP] - PAF - 24.06.2014

ok please explain it and correct the codes please then i will replace please


Re : Help Mysql Table?[+REP] - S4t3K - 24.06.2014

No.
I'll just explain you your mistake through a very useful link : http://www.w3schools.com/sql/sql_insert.asp

Read the whole documentation and your mistake will be as shining as the moon in a dark night.
Oh and btw, we are not in an SQL help forum. Your problem concerns the SQL language, not the pawn language. Next time, post in an SQL help forum.


Re: Help Mysql Table?[+REP] - PAF - 24.06.2014

format(query, sizeof(query), "INSERT INTO `Bans` (`Nick`, `UserIP`, `Admin`, `Reason`, `Unix`) VALUES('%e', '%s', '%s', '%s', '%d', '%d', '%d', '%s', '%d')", receivername, receiverip, sendername,, reason, 999999999999999999999999);

is this code are right and working