|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#31
|
|||
|
|||
|
Re: complex objects - more readable
Code:
$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(); }
|
|
#32
|
|||
|
|||
|
Re: more readable code
Code:
$ppm = new providerPayment ; Code:
$ppm = $business_entity->provider_payment_list->childAdd($pm_id) ; Code:
$business_entity->provider_payment_list->active_list[$c]->setPaymentTypeOID($pm_id); Code:
$f=$business_entity->provider_payment_list->active_list[$c]->getPaymentTypeOID(); Code:
/* 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(); }
|
|
#33
|
|||
|
|||
|
limit to 5 records
Hi,
<br> <br> How do I limit the number of rows to 5 using this class most efficiently? <br> <br> Thanks! <br> <br> I like the class very much! Thanks for the good article! <br> Heiko |
|
#34
|
|||
|
|||
|
Re: limit to 5 records
This is done in the SQL query you build....
<br> <code> <br> IE: $query = "SELECT * FROM testtable WHERE <br> fieldname='$myfield' <br> GROUP BY date_field DESC <br> LIMIT 5"; <br> </code> <br> Best Regards Arne |
|
#35
|
|||
|
|||
|
Re: Great article.
I would like to thank you kindly for making the classes in PHP as easy to understand as possible. This has greatly increased my learning and will lead to speedier development. This is definitely the best, the most concise and easiest to understand class tutorial I have found over the last few months. I would go as far to say that it is the most easiest to understand of many tutorials that I have seen over the years. Have you written any other articles and if so where can I locate them.
Thank you very much Cedric Edwards |
|
#36
|
|||
|
|||
|
database class
I'm building my own database class.
for the moment i only manage ODBC and MYSQL functions like connection, close , numrows , seek , insert , drop , next previous ... But (cause, there always a but), i would like to know if other people are doing the same and if they have the some difficulties making some functions. if some people can give me web site address i'll be glad too :-) Be the force with developers ^_^ |
|
#37
|
|||
|
|||
|
Re: database class
Hi,
i'm also doing a DB class, though it's MySQL only... in fact i'm building it for practical purposes (ie retrieving info ) as opposed to adminstrative purposes, so I don't need table drops etc.... At the moment i'm trying to do a function to retrieve data and place it in a table. I was going to try to generate the table dynamically depending on the amount of columns in the table being searched. DO you know of a way of doing this ? At the moment I am using the "query" and "next_record" functions described in the article, as well as a fetch function which goes: function dbfetch ($Fetch_String) { $this->dbconnect(); # printf("Debug: fetch = %s n", $Fetch_String); $this->Fetch_ID = mysql_db_query($this->database, $Fetch_String); $this->Row = 0; $this->Errno = mysql_errno(); $this->Error = mysql_error(); if (!$this->Fetch_ID) { $this->halt("Invalid SQL: ".$Fetch_String); } else { $this->Record=mysql_fetch_array($this->Fetch_ID); return $this->Record; } }//end dbfetch function But i haven't found a way of retrieving the columns names of the table columns.... Any ideas ? -nick |
|
#38
|
|||
|
|||
|
Urgente
Por favor nesecito informacion sobre propaganda , no se si me podrian ayudar , escreibanme ami email ..... |
|
#39
|
|||
|
|||
|
Re: accessing oracle database?
can someone please tell me how to compile php with Oracle support. i installed PHP and it works great with Apache, and MySql on win98 (plus CGI and Perl) - but it again i cant connet to Oracle with ora_logon.
thank you |
|
#40
|
|||
|
|||
|
Thanks - Direction?
This was excellent - I have been reading up on classes quit a bit now online. Any additional places you would recommend looking that perhaps includes examples of writing and updating to MySQL - although it might be good practice to expand this?
Regards, RBS |
|
#41
|
|||
|
|||
|
Re: Would we still need to call mysql_close()?
Like the previous author said mysql_close();
Look at www.php.net and go to the manual - look under the functions. if you are not using mysql_pconnect(); than no worries - but if you are not aware of mysql_pconnect you may want to brush up on that as well - it very useful if you are making several queries etc... |
|
#42
|
|||
|
|||
|
Re: Thanks - Direction?
You don't need to post this - I just wanted to say that this is just a smokin use of class! Thanks so much - I am going to look much smarter than I actually am!
|
|
#43
|
|||
|
|||
|
Re: %s
I have been trying to find out the purpose of the
<code> %s </code> that is used repeatedly in the example code. My best guess is standard output? |
|
#44
|
|||
|
|||
|
Great article
Thank you DevShed.com for this great article. You have helped me much, very much. Now I'm accessing my MySQL databases with class.
|
|
#45
|
|||
|
|||
|
great starter
Thanks kristian for initiating me to classes in Php .
Good one , and i would like to have more examples,where do i get them? |
![]() |
| Viewing: Dev Shed Forums > Other > Development Articles > Accessing Databases with Class |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|