Development Articles
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDevelopment Articles

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #16  
Old July 6th, 1999, 04:53 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
typo?

In reference to http://www.devshed.com/Server_Side/PHP/Class/page4.html

toward the end of Example 8 and at the begining of the while loop declaration..

<!-- Code -->
<p><pre><font color=#000000><xmp>
<?php while($db-<next_record()): ?>
</xmp></font></pre><p>
<!-- Code -->

shouldn't that be (-> instead of -<):

<!-- Code -->
<p><pre><font color=#000000><xmp>
<?php while($db->next_record()): ?>
</xmp></font></pre><p>
<!-- Code -->

Reply With Quote
  #17  
Old July 6th, 1999, 05:35 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Fixed

Thanks for the notice.

That error has been fixed.

Reply With Quote
  #18  
Old July 8th, 1999, 07:38 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Limiting the amount of records

maybe you use a wrong syntax. try
<br>
select ... LIMIT $start, $rows
<br>
<br>
where $rows is the amount of rows you want to get after startingpoint $start.
<br>
<br>
i use it and it works.
<br>
good luck

Reply With Quote
  #19  
Old July 8th, 1999, 08:14 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: shed

Hell no! This can't be true! :^)
<br>
<br>
This aint no steenkin Ebay or something!

Reply With Quote
  #20  
Old July 19th, 1999, 06:51 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
run this sample

I think this article is very useful for my work.

I tried to run with

<!-- Code -->
<p><pre><font color=#000000><xmp>
<?php
require("db_sql.inc");
require("db_bdgeo.inc");
$db = new DB_BDGEO;
$db->connect();
?>
</xmp></font></pre><p>
<!-- Code -->

but the server not translate the commands in the include files.

In the browser I see:

<!-- Code -->
<p><pre><font color=#000000><xmp>
class DB_Sql { // Definicion de Clase para conexion var $Host = "";
// Hostname of our MySQL server. var $Database = "";
// Logical database name on that server. var $User = "";
// User und Password for login. var $Password = "";
var $Link_ID = 0;
// Result of mysql_connect().
var $Query_ID = 0;
// Result of most recent mysql_query().
var $Record = array();
// current mysql_fetch_array()-result.
var $Row; // current row number.
var $Errno = 0;
// error state of query...
var $Error = "";
// insert functions here.
function halt($msg) {
printf("Database error: %s\n", $msg);
printf("SQL Error: %s (%s)\n", $this->Errno, $this->Error);
die("Session halted.");
}
function connect() { if ( 0 == $this->Link_ID ) {
$this->Link_ID=mysql_connect($this->Host, $this->User, $this->Password);
if (!$this->Link_ID) {
$this->halt("Link-ID == false, connect failed"); }
if (!mysql_query(sprintf("use %s",$this->Database),$this->Link_ID)) {
$this->halt("cannot use database ".$this->Database);
}
}
}
}
class DB_BDGEO extends DB_Sql { // Definicion de Clase para conexion
var $Host = "localhost"; // Hostname of our MySQL server.
var $Database = "bdgeo"; // Logical database name on that server.
var $User = "bdgeo"; // User und Password for login.
var $Password = "ubdgeo";
}
</xmp></font></pre><p>
<!-- Code -->

Fatal error: DB_BDGEO is not a class in /disk2/bdgeo/php3/index.php3 on line 4


I need the server interprets the class definition and not display the statments in the browser?

Can somebody tell me, how to obtain this?
What I need to do?
Also I like install the PHPLIB for sybase conection, żI Need compile the module?, How?
or only use the include apropiate?

Thank You

Luis A. Gonzalez

PS : I have installed apache_1.3.4
and php-3.0.11

Reply With Quote
  #21  
Old July 25th, 1999, 02:56 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: run this sample

Please remember that include files are
<br>
being read in HTML mode, so that you have
<br>
to switch to PHP again, even if require()
<br>
and include() are PHP commands.
<br>
<br>
Also, PHP is an interpreted language, there
<br>
is no need to compile.
<br>

Reply With Quote
  #22  
Old August 24th, 1999, 01:28 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
errors

How does $errno and $error in class db_sql get assigned values in function halt

Reply With Quote
  #23  
Old November 9th, 1999, 08:59 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
accessing oracle database?

HI,

i hav encountered a prob with accessing the oracle database, ora_open() function cant seem to work, i keep gettin the error of

(Fatal error: Call to unsupported or undefined function ora_logon() in /usr/local/apache/htdocs/test.php3 on line 6)

Can somebody help? Thanks!



Reply With Quote
  #24  
Old November 11th, 1999, 11:38 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Would we still need to call mysql_close()?

Hi all,

Then how would u close persistent links...
Or is it closed when the server times out after the user's request.


Thanks in advance,
ed

Reply With Quote
  #25  
Old December 16th, 1999, 01:12 AM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Please, help! (a bit offtopic)

Hello,
I've got a question abt PHP3 upload...
My HTML form works correct (data fields are added to PGSQL DB), and the browser sends the attached file, BUT: the temporary file shown as something like /tmp/upload/phpFGreHJ does NOT exist! I'm running PHP3, Apache1.3 on RedHat 5.2.2.
If anyone knows - please email me: mailto:thistle@ok.ru
And that's that. Thank you a priori!
=Ilia=

Reply With Quote
  #26  
Old January 11th, 2000, 06:38 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: Please, help! (a bit offtopic)

<P>Are you trying to upload the data directly into the DB or into a directory?</P>

<P>If you're uploading into a directory this is what I use:</P>


<!-- Code -->
<p><pre><font color=#008000><xmp>
$attach_name=strtolower($attach_name);
copy($attach, "../attach/$attach_name");
chmod( "../attach/$attach_name", 0777 );
unlink($attach);
</xmp></font></pre><p>
<!-- Code -->


<P>Remember that while the file itself is, in this case $attach, the file name is referenced as $attach_name</P>

<P>Hope this helps if it makes any sense to you :)</P>

<P>Stephen</P>

Reply With Quote
  #27  
Old January 11th, 2000, 11:33 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Thank you, Stephen

Hello Stephen,
Thank you it helped!
Good Luck!
=Thistle=

Reply With Quote
  #28  
Old May 2nd, 2000, 11:56 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Re: accessing oracle database?

Hi,
You have not compiled php with oracle , just compile php with oracle support.
priyal

Reply With Quote
  #29  
Old May 16th, 2000, 12:36 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Would class make the code slow?

hi all,
<br>
<br>
just wondering, would writing PHP with classes make it slower than straight PHP?
<br>
<br>
thx
<br>
<br>
herbert

Reply With Quote
  #30  
Old May 17th, 2000, 07:14 PM
guest
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
complex objects

i am having difficulties in adding an object to an array of objects and then viewing the value of a property. At first it works but then it doesn\'t. these first four lines create, add, set and get work but when I continue thru the following loop the first 6 iterations (there are already 6 objects in this array) go fine but the final iteration (the newly added object) I get a Call to a member function on a non-object

$ppm = new providerPayment ;

$ppm = $business_entity->provider_payment_list->childAdd($pm_id) ;

$business_entity->provider_payment_list->active_list[$c]->setPaymentTypeOID($pm_id);

$f=$business_entity->provider_payment_list->active_list[$c]->getPaymentTypeOID();

/* for loop */

for ($y = 0; $y < count($business_entity->provider_payment_list->active_list); $y++)

{
$z = $business_entity->provider_payment_list->active_list[$y]->getPaymentTypeOID();

}

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherDevelopment Articles > Accessing Databases with Class


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |