Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2006-01-04, 07:22 AM
Junior Member
 
Join Date: Jan 2006
Posts: 16
sheldongold
Default

Hi,

I am new to dynamic websites and have built my first ste for a friend starting a business and all was working fine on my test server at home running IIS, PHP5 and MYSQL5. The problem is that the hosts are only running version 4 and now nothing works.

I have altered the code and have changed things like mysqli('domainip', 'username'.... to mysql_connect('domainip', 'username'... and have removed all references to $result->autocommit(TRUE); and $result->autocommit(FASLE); (is there a php 4 alternative for this?)

I have also changed:

THIS if (!$result || $result->num_rows!=0)
TO THIS if(!$result || mysql_num_rows($result)!=0)

THIS for ($count=0; $row = $result->fetch_assoc(); $count++)
TO THIS for ($count=0; $row = pg_fetch_array($result); $count++)

THIS $num_cats = @$result->num_rows;
TO THIS $num_cats = @mysql_num_rows($result);

THIS $item = $result->fetch_object();
TO THIS $item = pg_fetch_array($result);

THIS $conn->commit();
TO THIS session_write_close($conn);

Are these correct? Am I doing this correctly - and is there somewhere where this kind of information is easily available??

Other possible problems are...

return $row->quoteid;

return $row->catname;

$item_price = $item->price;

$customerid = $customer->customerid;

$quoteid = $quote->quoteid;

I don't know if these need replacing.

The code seems to be running ok but querying the database does not seem to return any results. You can view the page at www.invate.co.uk/index.php - if you select either the desktop PC or the laptop you will be taken into the show_cat.php page - here you should have a menu of categories generated by php and sql and a list of products in that category. Accesing the admin area is not possible either - even with the correct details it says that i cannot login.

Any help will be greatly appreciated - I have searched everywhere for any help but I have not been able to find anything really on downgrading code from php5 to php4 (not the usual thing to do I suppose...). I have been pulling my hair out for over a wek now trying to make this all work!! Once again many thanks in advance and more thanks to come...

Reagrds
Sheldon

I can provide all the files as well as passwords to the admin area, the ftp server, and the database if neccessary...
Reply With Quote
  #2 (permalink)  
Old 2006-01-04, 10:57 PM
Junior Member
 
Join Date: Jan 2006
Posts: 16
sheldongold
Default

Got it all working. removed all autocommit statements. and changed some of the functions to prefix with mysql_ and that solved most things. The main thing was - silly me - I wasn't specifying the database name when connecting to it, just the ip, username and password. doh!!

Thanks for reading
Sheldon
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:57 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.