08.08.2011, 21:49
fread only reads one line of the file at a time. You'll need to read the whole file, then execute the query.
pawn Код:
stock CreateSQLTables( )
{
new szQuery[ 2000 ];
new szLine[ 128 ];
new File: sqltables = fopen( "sql.txt", io_read );
while( fread( sqltables, szLine ) )
{
strcat( szQuery, szLine );
// You may need to add \n to the end of the line due to syntax
}
fclose( sqltables );
mysql_query( szQuery );
}