Will mysql_get_server_info() give you what you need? <http://dev.mysql.com/doc/mysql/en/mysql_get_server_info.html>

Otherwise, I suppose you could

  SELECT VERSION();

and parse the result.

Michael

Matthew Boehm wrote:
Hey guys,
 I see there is a mailing list for all other API's except the built in one.
Hmmm. Anyway, I'm writing an app in C that will connect to a MySQL database
server and run some queries. I'd like to use prepared statements in some
cases but since prepared statements are only available in 4.1 or higher I
need to find out what the server's version is first.
 Normally I could just check MYSQL_VERSION_ID and if it is greater or equal
to 40100 then I can use the prepared statements. But, in my case, I'm using
the 4.1 client libraries but the test server I'm connecting to is 3.23.50
which will not support prepared statements. But if I use my MYSQL_VERSION_ID
method, everything will seem ok and the compiler will put in the unusable
4.1 code.

 I found this function on the docs: mysql_get_server_version()

 However, the docs say this was added in 4.1.

 So, how do I find the server's version that I am connected to if the
function I need to use won't work on pre 4.1 and the VERSION_ID check won't
work for different client-server versions?

Thanks,
Matthew

-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to