Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 6th, 2007, 11:49 PM   #1
tAK
Programmer
 
Join Date: Mar 2007
Posts: 33
Rep Power: 0 tAK is on a distinguished road
php4 mysql and php5 mysqli cross-over?

Hey everyone,

so i have been working on this system, and i finally get it upto an alpha test, and upload it to the webhost and all seems fine.

then.. bam. i find out that the webhost is running php4 not php5 !!! nightmare !!

so, i need to make all of my code run on the older mysql system instead of the new mysqli system as smoothly and quickly as possible..

any suggetions?

the webhost essentially has cpanel access to things, so i dont think its going to be possible to self update php.. and i must wonder how hard it would be for them to update it themselves (they are still running backwards compatbile to php2, but i just dont see why there arent more web hosts running php5.. from what i saw after a quick google search, most of the ones that advertise it seem a little dodgy)

.. oh well, probably not a lot of advice people can give, but if someone can put me onto something which might help, thats muchly appreciated.

/tAK
tAK is offline   Reply With Quote
Old Apr 7th, 2007, 4:19 AM   #2
rsnd
Hobbyist Programmer
 
rsnd's Avatar
 
Join Date: Jun 2005
Location: Helltown
Posts: 162
Rep Power: 4 rsnd is on a distinguished road
Write more flexible code.
__________________
Spread your wings and fly! Chicken!
rsnd is offline   Reply With Quote
Old Apr 7th, 2007, 6:05 AM   #3
tAK
Programmer
 
Join Date: Mar 2007
Posts: 33
Rep Power: 0 tAK is on a distinguished road
... ill consider that one day rsnd, for now, i am learning as i go.

in the mean time, i have just spent 3 hours going through everything updating(by downgrading its connection type) all of my code.
everything is now working and online (after i also found out that the damn webserver is case sensitive.. and in some of my SQL statements i used Members instead of members and it didnt work properly.. what a headache)
tAK is offline   Reply With Quote
Old Apr 7th, 2007, 12:02 PM   #4
LOI Kratong
Professional Programmer
 
Join Date: May 2005
Location: Woo - Boot Sector!
Posts: 294
Rep Power: 4 LOI Kratong is on a distinguished road
I'm not sure about your hosts, but mine run both, try a .php5 extension, it may solve you issues.
__________________
www.heldtogether.co.uk
LOI Kratong is offline   Reply With Quote
Old Apr 7th, 2007, 12:33 PM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Check around your control panel. My host allows me to select the PHP version.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Apr 27th, 2007, 3:05 AM   #6
Mocker
Hobbyist Programmer
 
Mocker's Avatar
 
Join Date: Oct 2005
Location: Indiana
Posts: 217
Rep Power: 0 Mocker is an unknown quantity at this point
Send a message via AIM to Mocker
A lot of hosts run php4 by default for compatibility with older scripts, but that doesn't mean they don't have php5 available as well. Check with your host to make sure, or ask they put it on the server as cgi.
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi
freelance scripts - http://ryanguthrie.com/index.html
Mocker is offline   Reply With Quote
Old Apr 29th, 2007, 10:48 PM   #7
tAK
Programmer
 
Join Date: Mar 2007
Posts: 33
Rep Power: 0 tAK is on a distinguished road
I had done that Mocker, They made up some mumbo jumbo about it not being proven, and how every script they provide is php4 compatible.

Basically, for the lower end plans they just didn't want to hear it, for now, i have gone with rsnd's advice.. i wrote more flexible code, but it just peeves me, because i did what i thought was the right thing.. i decided to learn PHP and started with PHP 5.

i have had to re-work my test environment, and i have changed hosts for my personal stuff to one that is php5 compatible (just incase).

Oh, i also discovered, that some of the hosts which offer php 5, require that you name your files .php5 in order to be processed via it.
As such, my test environment now runs to that standard, for php4 and php5 (i have a script which renames the files in batch, so i am good for changing to .php when needed)
tAK is offline   Reply With Quote
Old Apr 30th, 2007, 3:48 AM   #8
Mocker
Hobbyist Programmer
 
Mocker's Avatar
 
Join Date: Oct 2005
Location: Indiana
Posts: 217
Rep Power: 0 Mocker is an unknown quantity at this point
Send a message via AIM to Mocker
Naming files .php5 is also pretty standard, but there are ways around that too. I think every host should offer php5, at least in addition to php4. For hosts that require you to name your files .php5, usually you can get .php to work as well by adding to your .htaccess file:

AddType application/x-httpd-php5 .php

That should have apache parse it as php5 instead of the default php4. Depends on your host of course, but that is pretty standard for any linux/apache host
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi
freelance scripts - http://ryanguthrie.com/index.html
Mocker is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:54 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC