Re: [ROOT] MySQL and string troubles

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sun Nov 02 2003 - 10:40:32 MET


Hi,

Current versions of mySQL do not know ints and floats, only strings.
You must make the conversion yourself. New announced versions of
MySQL will support native basic types.

Please do not post to both roottalk and rootforum.

Rene Brun

On 
Sun, 2 Nov 2003, Dejan Nikic wrote:

> Hi,
> 
> I posted this on forum board, but in case some of you don't read it I
> wanted to post it here too:
> 
> 
> I've run into a weird problem. What I'm trying to do is gather bunch of
> data from MySQL and then plot it. I've got all the values from MySQL and
> if i do: 
> 
> print("%s", x[i]); 
> 
> inside a loop I get all the correct values. But if I do: 
> 
> print("%d", x[i]); or print("%f", x[i]); or print("%i", x[i]); I get
> some ridiculous 10^5 numbers. From here I assume that the root gets data
> from MySQL as strings, not as doubles or whatever the data might be
> inside MySQL. Now what I would like to do is get the graphing libs from
> root to be able to graph these correct values. 
> 
> it seems that TGraph() only works with doubles and integers and since I
> can't get this stuff from MySQL into the that form, could you tell me
> how I could do it? 
> 
> Thank you.
> 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET