Jump to content

Recommended Posts

Posted

So I'm building a financial planning site that adds up all sorts of data in all sorts of places, and I believe in some cases sub-queries can make your queries a lot more efficient. So when I built my site on my local box (Mac, os 10.3, php 4.somethin, mysql 4.something, apache2.something) I used sub-queries. When I moved my site to TCH hosting I found they didn't work. So first I'm just wondering why that is, and second, what do I need to do to get up and running? Do I just need to lay low until TCH updates its mysql version? Do I need to adjust my syntax? Do I need to just revamp my code to not use sub-queries? Anyway, I'll further explain what I mean by sub-query to make sure we're on the same page.

 

For example, the following query is ridiculous but shows what I mean. On my local box I can run the queries like

SELECT * FROM sometable WHERE sometable.blah IN (SELECT blah FROM sometable)

without any problems, but when I run queries like that on TCH I get your standard syntax error.

 

By the way, I'm new, and I just realized I probably stuck this question in the wrong spot. sorry about that, thanks much.

Posted

TCH runs MySQL 4.0.22 and subqueries were only recently made available in MySQL 4.1.

Even though 4.1 has been considered stable since October it's more a matter of cPanel and the scripts they include being compatible with 4.1. Who knows when this could happen but until then you can try Rewriting Subqueries as Joins.

Posted

First

:( Welcome to the Family ;)

 

and your new home!

 

from my cpanel

PHP Version 4.3.9

Mysql Version 4.0.22-standard

 

I can't help you with the syntax

but I will move it to scripting talk

for better exposure.

 

We really are like family here.

So if you need anything,

just ask your new family!

We love to help :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...