PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 21st, 2012, 04:41 PM
rogerraa rogerraa is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 5 rogerraa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 26 m 7 sec
Reputation Power: 0
Php4 to php5

Hello guys,

I'm helping someone who has needed to go from Debian/php4 to Ubuntu/php5 on their webserver. Its a small business who had their page made some years back(like 10 maybe). Since their OS/php version has changed there are some PostgreSQL queries that don't seem to work anymore. I'm used to MySql so PostgreSQL is completely new to me. I've tried searching the interweb and didn't find much if anything.


Here is the function that has the query in it.

Code:
function get_all_days_products($order_day, $order_month, $order_year)
{
        $conn = connectEfesDB();
        if (!$conn){
                noDBConn($conn);
                exit;
        }

	if($order_day < 10)
		$order_day = "0$order_day";
	if($order_month < 10)
		$order_month = "0$order_month";

	$query = "SELECT distinct P.product_id, product_code
		FROM products as P, order_items as OI, orders as O
		WHERE P.current_product='t'
		and O.order_id = OI.order_id
		and OI.product_id = P.product_id
		and O.delivery_date like '$order_year-$order_month-$order_day%'
		order by P.product_id";

        $products = pg_query($conn, $query);
        
	if (!$products){
                return;
        }
        for ($i=0; $i<pg_numrows($products); $i++){
                $product_list[$i]["id"]   = pg_result($products, $i, 0);
                $product_list[$i]["code"] = pg_result($products, $i, 1);
        }
        return $product_list;
}


Now all I know so far is it returns nothing. I don't have PostgreSQL on my personal webhost so I haven't been able to test around too much.
Do you see anything in there that would stop working going from php4 to php5?

Thanks so much any help..

Reply With Quote
  #2  
Old May 21st, 2012, 04:58 PM
shammat shammat is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Oct 2003
Location: Germany
Posts: 2,685 shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 3 Days 19 h 59 m 5 sec
Reputation Power: 284
Shouldn't you post this in a PHP forum?

If you have a specific SQL question, then please post SQL code, not PHP.

Reply With Quote
  #3  
Old May 21st, 2012, 05:08 PM
rogerraa rogerraa is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 5 rogerraa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 26 m 7 sec
Reputation Power: 0
my apologies

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > Php4 to php5

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap