Hi,
Your syntax is incorrect.
>cout << "ID: " << *Row[0]; // it
returns "48 too much"
It seems you are printing the ordinal value of Row[0]
Try using cout << "ID: " << Row[0]; Instead.
>cout << "Name: " << (char *) Row[1];
This works because all you're doing is a casting to char *
Regards,
Jorge
For technical support contracts, visit https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Jorge del Conde <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Mexico City, Mexico
<___/ www.mysql.com
-----Original Message-----
From: Christian Terboven [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 12, 2001 5:45 PM
To: [EMAIL PROTECTED]
Subject: strange integer problem
Hi all!
I`ve got a quite strange problem.
When querying my database, all my integer values are exactly 48 too
high.
Assuming the following code (using Linux):
Database layout:
(ID INT, Name CHAR(100), ...)
m_pResult = mysql_store_result(&m_Connection);
// get the first record
m_iCurrentDataset = 0;
mysql_data_seek(m_pResult, m_iCurrentDataset);
MYSQL_ROW Row;
Row = mysql_fetch_row(m_pResult);
cout << "ID: " << *Row[0]; // it
returns "48 too much"
cout << "Name: " << (char *) Row[1]; // works fine
Has anybody an idea?
Thanks in advance
Christian Terboven
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php