[SQL] Says "field not found" when it exists
#1

Hi.

I spent a long time these days to work and try to learn a few things about MySQL. Thanks to the nice tutorials around here, it's been a good time until I wanted to go further.

So, I don't know why, but one of my 'cache_get_field_content' returns 'field not found' in the logs, and of course, I also have no value, whereas the field does exist.

pawn Код:
[02:51:22] [DEBUG] cache_get_field_content - row: 0, field_name: "IP", connection: 1, max_len: 16
[02:51:22] [WARNING] CMySQLResult::GetRowDataByName - field not found ("IP")
pawn Код:
cache_get_field_content(0, "IP", DBIP0, mysql, 16);
Maybe I missed something, but I whish you could tell me what I don't understand, thanks.
Reply
#2

Is there something in the field? or is it blank?
Reply
#3

Try this:
Код:
cache_get_field_content(0, "IP", DBIP0, 16);
Reply
#4

Quote:
Originally Posted by Blademaster680
Посмотреть сообщение
Is there something in the field? or is it blank?
Actually, there is one player registered in the database, me with 127.0.0.1, and the DB looks completly okay.

Quote:
Originally Posted by dirigent00
Посмотреть сообщение
Try this:
Код:
cache_get_field_content(0, "IP", DBIP0, 16);
Result:

[13:12:21] [ERROR] "cache_get_field_content" - invalid connection handle (ID = 16)

And with:

pawn Код:
cache_get_field_content(0, "IP", DBIP0);
Sends field not found.
Reply
#5

Show the query.
Reply
#6

This one?

pawn Код:
mysql_format(mysql, query, sizeof(query),"SELECT `Password`, `ID` FROM `playersdata` WHERE `Username` = '%s' LIMIT 1", pName[playerid]);

mysql_tquery(mysql, query, "UserAccount", "i", playerid);
Reply
#7

Yes, well how do you expect to fetch the IP if you're not even selecting it? I'll take you know what that keyword is for?
Reply
#8

Okay, that's something I didn't know, it works perfectly now, of course, I seriously need to work more on it.

Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)