Follow us on Twitter!
Things are more like they are now than they have ever been before. - Dwight D. Eisenhower
Friday, April 18, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 10
Guests Online: 9
Members Online: 1

Registered Members: 82822
Newest Member: TheBunter
Latest Articles
View Thread

HellBound Hackers | Computer General | General Computer Problems

Author

MySQL Query

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 24-09-07 09:49
Code

 SELECT count( p.products_id ) AS total
FROM products_description AS pd, products AS p
LEFT JOIN manufacturers AS m ON p.manufacturers_id = m.manufacturers_id, products_to_categories p2c
LEFT JOIN specials AS s ON p.products_id = s.products_id
WHERE p.products_status = '1'
AND p.products_id = p2c.products_id
AND pd.products_id = p2c.products_id
AND pd.language_id = '1'
AND p2c.categories_id = '176'





Code
#1054 - Unknown column 'p.products_id' in 'on clause'




Its mySQL v5. I have this exact same setup on a live up and running website and it works fine. however i'm setting up a development environment on a new server, and i've had to upgrade from MySQL 4 to MySQL 5.. and now i get this error.

the table products deffinatly exsists.. products_id deffinatly exsists. yet i get this error.. im sure my JOIN's are fine.

suggestions?


http://www.hellboundhackers.org/
Author

RE: MySQL Query

spyware
Member



Posts: 4192
Location: The Netherlands
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 24-09-07 09:53
-stupid comment-

EDIT:

Try inputting your SQL syntax directly into the input box rather than using PHP. See what happens.



img507.imageshack.us/img507/3580/spynewsig3il1.png
"The chowner of property." - Zeph
[small]
Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.
- Carl Sagan
“Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?” - Ebert
[/s

Edited by spyware on 24-09-07 09:55
http://bitsofspy.net
Author

RE: MySQL Query

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 24-09-07 09:56
p.products_id deffinatley exsists.

all the tables and colums are deffiantly there, becuse im using the exact same setup on another server using mySQL v4.

i figure its a v4 / v5 issue, because we all know v5 is alot more sensitive.

i just cant figure out which bit if wrong... :whoa:

and yes, i thought maybe it was a connection issue, so now im using phpmyadmin and it still gives same error.




Edited by Mr_Cheese on 24-09-07 09:57
http://www.hellboundhackers.org/
Author

RE: MySQL Query

spyware
Member



Posts: 4192
Location: The Netherlands
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 24-09-07 10:02
Happy searching ;x

http://dev.mysql.com/doc/refman/5.0/en/news.html



img507.imageshack.us/img507/3580/spynewsig3il1.png
"The chowner of property." - Zeph
[small]
Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.
- Carl Sagan
“Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?” - Ebert
[/s
http://bitsofspy.net
Author

RE: SQL


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 24-09-07 10:03
LEFT JOIN manufacturers AS m ON p.manufacturers_id = m.manufacturers_id, products_to_categories p2c propably you forgot a comma(,) or as Q?
Author

RE: MySQL Query

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 24-09-07 10:15
Thanks for the replies, i've now fixed it.

solution:
Code


SELECT count( p.products_id ) AS total
FROM (products_description AS pd, products AS p, products_to_categories p2c)
LEFT JOIN manufacturers AS m ON p.manufacturers_id = m.manufacturers_id
LEFT JOIN specials AS s ON p.products_id = s.products_id
WHERE p.products_status = '1'
AND p.products_id = p2c.products_id
AND pd.products_id = p2c.products_id
AND pd.language_id = '1'
AND p2c.categories_id = '176'





dam MySQL v5!


http://www.hellboundhackers.org/