473,386 Members | 1,810 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,386 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 3838
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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,...

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.