List:MySQL++« Previous MessageNext Message »
From:Ian Daysh Date:March 15 2007 8:41am
Subject:RE: does 'AS' work?
View as plain text  
Looking at the original line from your program, it maybe that row["id"] is returning a
value that means you get an result with 0 rows. That would give the error that you're
seeing.

Had that a few times in one of my programs. Put a line after your query with
	std::string qrybuf = query.preview();

in and see what the value of qrybuf is. That will then let you see what exactly is being
sent to the mysql server.

Ian.

-----Original Message-----
From: Denis 'SciFi' Simonet [mailto:sad123@stripped]
Sent: 14 March 2007 14:38
To: plusplus@stripped
Subject: does 'AS' work?


hi

i use the following query:
query2 << "SELECT show_data.id AS showid, show_data.player AS player, (2 
* player_gamedata.str * player_gamedata.tech) AS att, (2 * 
player_gamedata.dex * player_gamedata.qui) AS def, (15 * 
player_gamedata.con) AS hp, player_gamedata.finisher AS finisher, 
player_settings.image AS image, player.wname AS wname FROM (show_data, 
player, player_gamedata, player_settings) WHERE show_data.shownr = '"
                                << row["id"]
                                << "' AND player.id = show_data.player 
AND player_settings.player = show_data.player AND player_gamedata.player 
= show_data.player ORDER BY showid ASC";

But it then the use of row["showid"]throws an exception:
Error: Unknown field name: showid

The query itself is ok:
mysql> SELECT show_data.id AS showid, show_data.player AS player, (2 * 
player_gamedata.str * player_gamedata.tech) AS att, (2 * 
player_gamedata.dex * player_gamedata.qui) AS def, (15 * 
player_gamedata.con) AS hp, player_gamedata.finisher AS finisher, 
player_settings.image AS image, player.wname AS wname FROM (show_data, 
player, player_gamedata, player_settings) WHERE show_data.shownr = '1' 
AND player.id = show_data.player AND player_settings.player = 
show_data.player AND player_gamedata.player = show_data.player ORDER BY 
showid ASC;
+---------+--------+-------+------+-----+----------------------------------------------------+--------------------+----------------+
| showid  | player | att   | def  | hp  | 
finisher                                           | image              
| wname          |
+---------+--------+-------+------+-----+----------------------------------------------------+--------------------+----------------+
| 3901622 |  12102 |  1404 | 1352 |  90 | und geht mit OErni erstmal 
einen rauchen           | img/user/12102.jpg | PPlinky        |
| 3901623 |   1528 |  4608 | 3528 |  75 | mit der Hilfe von 
The-Game                         | img/user/1528.jpg  | BTSVsolider    |
| 3901624 |  12415 |    72 |  154 |  90 | via 3-count after a 
devastatingWhisper-in-the-Wind | img/user/12415.jpg | Archangelus    |
| 3901626 |  11088 |   612 |  578 | 255 |  mit dem Last 
Kick                                 | img/user/11088.jpg | ChrisFeader123 |
| 3901637 |   5040 | 10800 | 8450 |   0 |   via the Death Crew 
Rites                         | img/user/5040.jpg  | TheScorpion    |
| 3901640 |   8233 |  3526 | 3280 | 150 | via  westside F-U und danach 
der Westside STFU     | img/user/8233.jpg  | John cena12    |
| 3901644 |    267 |   722 |  432 | 195 |   weil LeoN ihm mit dem 
Chokeslam hilft            | img/user/267.jpg   | DeadKennedy    |
| 3901648 |    244 |  1620 | 1512 | 300 | durch alle Finisher der 
gesamten GCW-Stables!      | img/user/244.jpg   | Leo            |
| 3901651 |   1789 |  9940 | 8978 | 540 | Nachdem Er Ihn An Den Ohren 
Aus Den Ring Zieht     | img/user/1789.jpg  | BLACKPANTER    |
+---------+--------+-------+------+-----+----------------------------------------------------+--------------------+----------------+
9 rows in set (0.01 sec)

What's the problem now? Has MySQL++ got problems with AS? Should it at 
all work like this?
And if no, what field name does it take for the att for example?

thank you and best regards,
Denis 'SciFi' Simonet

-- 
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:    http://lists.mysql.com/plusplus?unsub=1


This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorised and may be illegal.

Surrey Satellite Technology Limited
Registered Office: Senate House, University of Surrey, Guildford, 
Surrey, GU2 7XH   Registered in England & Wales No. 1916260 . VAT 
Registration No. GB 413 5711 79
Thread
does 'AS' work?Denis 'SciFi' Simonet14 Mar
  • Re: does 'AS' work?Warren Young15 Mar
RE: does 'AS' work?Ian Daysh15 Mar