![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Mar 2007
Posts: 33
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: Helltown
Posts: 162
Rep Power: 4
![]() |
Write more flexible code.
__________________
Spread your wings and fly! Chicken! |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Mar 2007
Posts: 33
Rep Power: 0
![]() |
... 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) |
|
|
|
|
|
#4 |
|
Professional Programmer
Join Date: May 2005
Location: Woo - Boot Sector!
Posts: 294
Rep Power: 4
![]() |
I'm not sure about your hosts, but mine run both, try a .php5 extension, it may solve you issues.
__________________
www.heldtogether.co.uk |
|
|
|
|
|
#5 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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 |
|
|
|
|
|
#6 |
|
Hobbyist Programmer
|
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 |
|
|
|
|
|
#7 |
|
Programmer
Join Date: Mar 2007
Posts: 33
Rep Power: 0
![]() |
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) |
|
|
|
|
|
#8 |
|
Hobbyist Programmer
|
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|