mysql failed query question..
#1

A couple days ago I look at my server tables for house and businesses. I noticed that most of the houses and businesses "owner" field was set to "NULL". No where in my script it says to do that, so I have reason to believe that a failed MySQL query has failed and caused this. But I have not added any new queries that interfere with houses/businesses lately.

So, what would a query that would make this happen insist of? Or perhaps too many queries executing at the same time?

Thanks.
Reply
#2

check the logs?
Reply
#3

Quote:
Originally Posted by Kar
View Post
check the logs?
Thanks for your help smart ass but I already checked the logs.
Reply
#4

NULL basically means nothing, or empty, so it makes sense to be there if there is no value for that field!

Anyway, you may have set up your table to default the values to NULL.
Reply
#5

Quote:
Originally Posted by Bakr
View Post
NULL basically means nothing, or empty, so it makes sense to be there if there is no value for that field!

Anyway, you may have set up your table to default the values to NULL.
No, no, it was working before, every house had house a owner before. But then after a restart, they we're all set to NULL. They also aren't defaulted to NULL, even if they were, they shouldn't of been defaulted the original value.
Reply
#6

Quote:
Originally Posted by Bakr
View Post
NULL basically means nothing, or empty, so it makes sense to be there if there is no value for that field!

Anyway, you may have set up your table to default the values to NULL.
Wrong.

NULL is not the number zero.
NULL is not the empty string (“”) value.

NULL means unknown - hence the problem with MySQL loading an unknown.

Just hold on, I'm trying to figure out the problem. It COULD be that you've done this ... WHERE `value` = '%' (for example, the point is the lack of string definer (sorry my terminology is bad))
Reply
#7

Quote:
Originally Posted by Antonio [G-RP]
View Post
Wrong.

NULL is not the number zero.
NULL is not the empty string (“”) value.

NULL means unknown - hence the problem with MySQL loading an unknown.

Just hold on, I'm trying to figure out the problem. It COULD be that you've done this ... WHERE `value` = '%' (for example, the point is the lack of string definer (sorry my terminology is bad))
Not to be rude, but are you blind or just completely stupid? Where did I ever say anything about the number zero? And I thought it would be obvious an empty string is equal to nothing, or empty.
Reply
#8

Quote:
Originally Posted by Antonio [G-RP]
Посмотреть сообщение
Wrong.

NULL is not the number zero.
NULL is not the empty string (“”) value.

NULL means unknown - hence the problem with MySQL loading an unknown.

Just hold on, I'm trying to figure out the problem. It COULD be that you've done this ... WHERE `value` = '%' (for example, the point is the lack of string definer (sorry my terminology is bad))
PHP код:
UPDATE house SET owner='blah' WHERE owner='' 
That wouldn't update anything, and if it did, it would update it to 'blah', not null.
Reply
#9

Quote:
Originally Posted by lolumadd_
View Post
Thanks for your help smart ass but I already checked the logs.
nice, you didn't even state that you checked the logs, so I gave a simple suggestion yet you burst out? cool.
Reply
#10

Quote:
Originally Posted by Kar
View Post
nice, you didn't even state that you checked the logs, so I gave a simple suggestion yet you burst out? cool.
I didn't burst out and you said "check the logs?" not "Try checking the logs." There is a difference between the two, the second one is much more polite.
Reply
#11

Quote:
Originally Posted by lolumadd_
View Post
I didn't burst out and you said "check the logs?" not "Try checking the logs." There is a difference between the two, the second one is much more polite.
Okay, it seemed like my response was a "command" and not a question, I guess..

anyway.. try debugging the loading, then gmx and print the loading. see what it outputs?

Maybe your ongamemodeexit is being called after ongamemodeinit? (I've seen this before when you gmx)
Reply
#12

I have a lot of this:

PHP код:
Error (0): Failed to exeute queryYou have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL' at line 1. 
Reply
#13

can you show the query string, please change the field names if you feel insecure
Reply
#14

Nothing wrong with the query...

PHP код:
UPDATE house SET owner='%s' WHERE id=%d LIMIT 1 
I recently added the LIMIT 1. Also, there are many places where the table are getting updated (e.g: player purchasing house, gamemodeexit the businesses and houses save under a loop, etc.)
Reply
#15

Make sure that the string name for mysql_query is the same string you formatted the SQL query with. Could you please show us the format line + the mysql_query line.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)