Well, I was updating the wiki, so I choose to update the MySQL functions first. I edited some, then came to the mysql_info function, I connected to the database and tried doing this:
print( mysql_info( handler ) );
It gave me null.
Then I tried searching it in the MySQL website. Got this:
http://dev.mysql.com/doc/refman/5.0/en/mysql-info.html
So, after reading that, I came back to the script, did some queries and then tried the mysql_info, but it still gave me null. What am I doing wrong? How can I fix that?
Any help? pl0x
not sure but this info might help you http://www.w3schools.com/php/func_mysqli_info.asp
R u updating wiki or this is for your server
Quote from: Coolkid on Mar 04, 2016, 07:31 PMR u updating wiki or this is for your server
Updating wiki, and as well, it would help me with my server.
And also, this is for helping, not for asking questions like that
@Kusanagi I also gave a link to the official MySQL webpage for that function, and tried the same way and followed your link too, still then, it returns null
Works fine here:
[SCRIPT] Rows matched: 1 Changed: 1 Warnings: 0
Doing the query twice, which means the row is already changed returns
[SCRIPT] Rows matched: 1 Changed: 0 Warnings: 0
Just make sure you actually do the queries the manual says:
QuoteINSERT INTO ... SELECT ...
String format: Records: 100 Duplicates: 0 Warnings: 0
INSERT INTO ... VALUES (...),(...),(...)...
String format: Records: 3 Duplicates: 0 Warnings: 0
LOAD DATA INFILE ...
String format: Records: 1 Deleted: 0 Skipped: 0 Warnings: 0
ALTER TABLE
String format: Records: 3 Duplicates: 0 Warnings: 0
UPDATE
function onScriptLoad( )
{
local conn = mysql_connect("localhost", "test", "test", "test");
if ( conn ) {
mysql_query(conn, "UPDATE benchmark SET testFloat = 123.45 WHERE testInt = 0");
print( mysql_info(conn) );
}
}
Quote from: Thijn on Mar 04, 2016, 08:21 PMWorks fine here:
[SCRIPT] Rows matched: 1 Changed: 1 Warnings: 0
Doing the query twice, which means the row is already changed returns
[SCRIPT] Rows matched: 1 Changed: 0 Warnings: 0
Just make sure you actually do the queries the manual says:
QuoteINSERT INTO ... SELECT ...
String format: Records: 100 Duplicates: 0 Warnings: 0
INSERT INTO ... VALUES (...),(...),(...)...
String format: Records: 3 Duplicates: 0 Warnings: 0
LOAD DATA INFILE ...
String format: Records: 1 Deleted: 0 Skipped: 0 Warnings: 0
ALTER TABLE
String format: Records: 3 Duplicates: 0 Warnings: 0
UPDATE
function onScriptLoad( )
{
local conn = mysql_connect("localhost", "test", "test", "test");
if ( conn ) {
mysql_query(conn, "UPDATE benchmark SET testFloat = 123.45 WHERE testInt = 0");
print( mysql_info(conn) );
}
}
I tried this:
function onScriptLoad(){
local conn = mysql_connect("localhost","test","test","vcmp");
if( !conn ) return;
mysql_query(conn,format("INSERT INTO Bans(name,uid,ip) VALUES('%s','%s','%s')","KAKAN","something","127.0.0.1" ) );
print( mysql_info( conn ) );
}
Giving the result as null
@KAKAN Read the MySQL documentation (http://dev.mysql.com/doc/refman/5.0/en/mysql-info.html) more closely.
Quotemysql_info() returns a non-NULL value for INSERT ... VALUES only for the multiple-row form of the statement (that is, only if multiple value lists are specified).