Domain Empire

What the **** is up with my script?!?

Spaceship Spaceship
Watch

tm

Established Member
Impact
25
Hey,

Im trying to find a string in a database.

I KNOW the string is there, i can find it easily in phpmyadmin.

I'm DEFINATELY connecting to the database, otherwise the script would die().

I've checked that everything is spelled correctly.

so WHY is it returning 0 numrows?!? There's definately a good two or three in the database (WHERE string='$q').

I've turned on error reporting
error_reporting(E_ALL);
but nothings coming up.

Me and several other people are STUMPED, so I need help!

thanks,

tm
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Here 2v:

SELECT * FROM table WHERE string = 'A'

Yeah, what would escaping the $ do??
 
0
•••
tm said:
Here 2v:

SELECT * FROM table WHERE string = 'A'

Yeah, what would escaping the $ do??
Ok, so which is it? In this post it's string, and in the script you posted it's strng.

And again, it goes back to being that "string" is a reserved keyword

Then again, who knows? I need to go back to sleep. :tri:
 
Last edited:
0
•••
lol, its not actually 'string', its a different word.. i'm just changing it in this thread to protect something... dont ask ;)

but it definately is spelt correctly ;)
 
0
•••
Run the query in phpmyadmin (Run SQL query) and see what happens,

Flubb
 
0
•••
I did that earlier, it said 0 rows found.
 
0
•••
Try changing 'string' to something else (And of course editing the db value) and see if that works,

If not, ask your hosting support staff, might be something else going on.

Flubb
 
0
•••
then obviously there is something wrong with your query. Maybe you got something wrong. Maybe wrong column, or wrong data, but it is definitely not the PHP code's fault. THat's all I can say. MAKE SURE you are doing the right column and the data is REALLY in the database. Nobody else can help you at this moment now, because you can't give access to your database.
 
0
•••
"string" isn't a reserved word i do believe anyway


can you post the rows + data in the db?
 
0
•••
I think that it is confidential data. The column isn't even string, it's a "secret" field. So anyway, good luck with your database, nobody can help you anymore at this moment.
 
0
•••
aznchong91 said:
then obviously there is something wrong with your query. Maybe you got something wrong. Maybe wrong column, or wrong data, but it is definitely not the PHP code's fault. THat's all I can say. MAKE SURE you are doing the right column and the data is REALLY in the database. Nobody else can help you at this moment now, because you can't give access to your database.

There is nothin wrong with the query; it runs fine but just returns an empty set.

If "string" would be a reserved word, you wouldn't be able to create it inthe first place (MySQL would let you know by presenting a error message).

It's really simple: if you run the query with field = 'whatever' and MySQL returns an empty set, you're field/value combination is just not present in that table.

Select any table in phpMyAdmin, click the "SQL" tab and run the query and try tuning it untill you get what you want.

-monty
 
0
•••
that's basically what I said... I meant that the query is wrong because either that value actually doesn't exist in the database or the field is wrong.
 
0
•••
Except, the query is right, and it is in the database... no spelling mistakes, it's definately there, i've double-checked at least 10 times, its returning no errors so i don't see why it's not working.
 
0
•••
0
•••
tm said:
Except, the query is right, and it is in the database... no spelling mistakes, it's definately there, i've double-checked at least 10 times, its returning no errors so i don't see why it's not working.

If it is in the database, in the table you're querying, the query should return the right set, not an empty one unless it's a bug (you might want to look into this at the bug section at dev.mysql.com but it's a long shot), I just can not think of any other explanation. If you would be prepared you give up on your secrecy and give my the SQL code so I can create the same table, I would fix your problem within minutes (as many others around here would), I am sure! But this way you're making it kinda hard to help out...

Feel free to PM me if you want, I'm happy to help you out (all I need is the SQL to create the same table and the row of data which you are looking for).

-monty
 
Last edited:
0
•••
Hey,

the table is over 2000 rows long, but i'm PMing you anyway.
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back