• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fatal error: Call to undefined function

[eluser]Bob Puzld[/eluser]
I get the following error in one of my view pages...

Fatal error: Call to undefined function mysql_to_human() in /home/rrrprogr/public_html/system/application/views/users/view.php on line 104

Here is the code from that page (line 104 is the last line)...

  <table class="datatable">
  <tr><th>Status</th><th>Date Requested</th><th>Date Paid</th><th>Recipient</th><th>Amount</th></tr>
  &lt;? if($payouts->num_rows() != 0): ?&gt;
    &lt;? foreach($payouts->result() as $row):
       if($row->organization_id != 0) {
         $status = '-';
         $data_paid = '-';
       elseif($row->date_paid == 0) {
         $status = '<strong style="color: #CC0000;">Pending</strong>';
         $date_paid = '-';
       else {
         $status = '<strong style="color: #66CC33;">Paid</strong>';
         $date_paid = mysql_to_human($row->date_paid);

Does anyone know where this function would or should be located? I cannot find it in the controller or the model. I have recently upgraded to the latest version of codeigniter (1.7.2), and this error now appears. Any ideas would be great. Thanks.

Where did you found this function mysql_to_human?
I know only one function unix_to_human in Date helper.
May be you forgot to load something?

[eluser]Bob Puzld[/eluser]
mysql_to_human is in my code. I found another post in the forum that relates to this...


Did you extend the date helper and load it? http://ellislab.com/codeigniter/user-gui...lpers.html

Look, if you won't solve your problem, just try to use DateTime class. There are format method that helps you.
For example:
$now = date("F j, Y, g:i a");
$t = new DateTime($now);
echo $t->format('Y-m-d');

[quote author="Bob Puzld" date="1257220119"]
mysql_to_human is in my code.

Correct - google only manages to find references to that function on this web site .. in messages written by you.

I'd suggest a grep -R would be appropriate at this time.

[eluser]Bob Puzld[/eluser]
GIN, thanks to your point regarding "unix_to_human" I was able to solve my problem. I simply changed
and it fixed the error. Thanks for your help everyone.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.