473,406 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

PHP 4 compatible switchover (Help Needed)

Jon
function fetch_row($query, $autoclose = true)
{
if(is_string($query))
$query = self::query($query, true);
$return = mysql_fetch_row($query);
if($autoclose)
self::close($query);
return $return;
}

In PHP4 i get an error stating that the $query= self::query line
contains an "Undefined class name 'self'"

how, in general, can I take this and make it php4 compatible?$query is
defined as

function query($query, $return = false)
{
$fetch = mysql_query($query, $this->connection) or
die2(mysql_error($this->connection));
if($return)
return $fetch;

Any help would be appreciated...

Jon

Jan 22 '06 #1
3 3840
Jon wrote:
In PHP4 i get an error stating that the $query= self::query line
contains an "Undefined class name 'self'"

how, in general, can I take this and make it php4 compatible?>


When the class is instantiated, simply replace "self::" with "$this->"; when
used statically, replace it with "ClassName::".
JW

Jan 22 '06 #2
Jon
On 2006-01-22 16:10:43 -0600, "Janwillem Borleffs" <jw@jwscripts.com> said:
Jon wrote:
In PHP4 i get an error stating that the $query= self::query line
contains an "Undefined class name 'self'"

how, in general, can I take this and make it php4 compatible?>


When the class is instantiated, simply replace "self::" with "$this->";
when used statically, replace it with "ClassName::".
JW


Thanks for your post, I think this will be immesly helpful. Now, one
last question to set me straight. How can I tell when a class is
instantiated vs. statically?

Thanks a bunch!
jon

Jan 22 '06 #3
Jon wrote:
Thanks for your post, I think this will be immesly helpful. Now, one
last question to set me straight. How can I tell when a class is
instantiated vs. statically?


By the way it's called:

Instantiated: $class->method();
Statically: ClassName::method();
JW
Jan 28 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: jfancy-Transport Canada | last post by:
I have this code here that reads in a javascript file and increases or decreases font by its relative size (same thing as View, Text Size, Large, small, etc.) I am developing this for Transport...
9
by: christer-sandberg | last post by:
When I typecast a function and call it trough the casted pointer (se code below) I get the warnings: warning: function called through a non-compatible type if this code is reached, the program...
1
by: Bucko | last post by:
Hi guys, I have an app that, right now, uses a SQL Server database and very simple, universal SQL commands. I use SqlCommand, SqlDataReader and SqlDataAdapter objects. I use web.config to...
5
by: max | last post by:
Dear all, I did the following analysis to conclude that the following pointer types are not compatible. Please let me know If my analysis and interpretation of the C standard are correct: ...
3
by: A.M | last post by:
Hi, I am planning to develop python applications on windows and run them on Linux. Are ActivePython scripts compatible with Linux? Is there any guideline that explains the compatibility...
2
by: ruediger.papke | last post by:
Hello, we want to build up a DB2- switchover cluster on 2 solaris machines, where a db2-instance is switched from one server to another. we have 2 machines (a,b) with OS solaris 5.9. both...
1
by: GHUM | last post by:
Hello, I created lots of guids via pywintypes.CreateGuid() on windows. Now I would like to run the same software on Linux / Solaris / FreeBSD. So I should produce "compatible" GUIDS on...
6
by: pavanip | last post by:
Hi, I have developed one windows application using vb.net. I have setup that application on windows operating system its working fine on windows os. Now I am trying to do that exe run on Mac...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.