mIRC Home    About    Download    Register    News    Help

Print Thread
#27141 30/05/03 11:07 PM
S
ShavedApe
ShavedApe
S
Could someone please look at the following and see if they can tell me why this might not work or rather why I get an error at the end.

alias tests {
echo -a $dll(mysql.dll,Connect,main -uwd %username %pass %dbase)
var %query = SELECT table FROM test WHERE table='testing' OR table='testing1' ORDER BY preid ASC
echo -a $dll(mysql.dll,Query,main %query)
var %n = echo -a $dll(mysql.dll,rows,main)
echo -a $dll(mysql.dll,fields,main)
var %i = 1
while (%i <= %n) {
echo -a $gettok($dll(mysql.dll,fetchrow,main %i 32),6-,32)
inc %i
}
echo -a $dll(mysql.dll,Close,main)
}


Here is what it returns

1 010 Connect main
1 022 Query main 1
1 023 Fields main 1 table
testing1
testing
-
* /echo: insufficient parameters (line 68, test.mrc)
-

a breakdown of the text =

1 010 Connect main =
<a> <b> <c> [d]
Where <a> would be 1 or 0, signifying success and failure, respectively, <b> would be the error
code number, <c> would be the function name, and [d] would be any additional information.

Last edited by ShavedApe; 30/05/03 11:22 PM.
#27142 30/05/03 11:14 PM
C
codemastr
codemastr
C
You have several echo's there, which one is on line 68?

#27143 30/05/03 11:19 PM
S
ShavedApe
ShavedApe
S
sorry should should of pointed that out

line 68 = echo -a $gettok($dll(mysql.dll,fetchrow,main %i 32),6-,32)

Last edited by ShavedApe; 30/05/03 11:22 PM.
#27144 31/05/03 04:00 AM
C
codemastr
codemastr
C
If you were to just have:

echo $dll(mysql.dll,fetchrow,main %i 32)
will it then output something, or do you still receive the error? If you still receive the error, then the problem is either the query you made to MySQL returned no results, there is something wrong with the dll, or you have an error somewhere in your MySQL queries.

#27145 31/05/03 06:03 AM
S
ShavedApe
ShavedApe
S
looks like it may have been a mysql query problem.

Thanks for the help

#27146 31/05/03 06:13 PM
C
codemastr
codemastr
C
although I haven't played with that dll, I'd assume it has some sort of "error" function in the dll that you can call? MySQL does a pretty good job of telling you where the error is, so if the dll lets you get that information it should make it easy to find the problem.


Link Copied to Clipboard