Welcome Guest, Not a member yet? Register   Sign In
View providing no results, but table has recent entries
#1

[eluser]Bob Puzld[/eluser]
Hi, I am having problems with my site. The site is a bottle/can collection site, where people can request to have bottles and cans picked up and then they can request payout of their account. Well, the page where you can view all requested payouts is not showing any results even though the table says differently. This has been a problem since the server was upgraded with PHP Version 5.2.6 (previously 4.32) and MySQL Version 5.0.67 (previously 3.23). Any suggestions would be great?? Here is some info to start with...

VIEW PAGE (I added var_dump to check it)

Code:
<h1>Payments Requested (&lt;?=$payouts->num_rows?&gt;)</h1>

&lt;?
    echo "<pre>";
    var_dump ($payouts->result_array);
    echo "</pre>";
?&gt;

&lt;? if($payouts->num_rows != 0): ?&gt;
  &lt;?=form_open('users/payment_requests_process')?&gt;
  <table id="report" cellspacing="0">
  <tr><th>Account Number</th><th>Name</th><th>Address</th><th>Balance</th><th>Amount Requested</th></tr>
  &lt;? $i = 1;
     foreach($payouts->result as $row): ?&gt;
    <tr &lt;?= alternator('',' class="altrow"') ?&gt;>
      <td>&lt;?=$row->id?&gt;&lt;input type="hidden" name="payout&lt;?=$i?&gt;" value="&lt;?=$row-&gt;payout_id?&gt;" /></td>
      <td>&lt;?=$row->fname.' '.$row->lname?&gt;</td>
      <td>&lt;?= $row->address.'<br />'.$row->city.', '.$row->state.' '.$row->zip?&gt;</td>
      <td>&lt;?=$row->balance?&gt;</td>
      <td>&lt;?=$row->amount?&gt;</td>
    </tr>
  &lt;? ++$i;
     endforeach; ?&gt;
  </table>
  &lt;input type="hidden" name="num_payouts" value="&lt;?= $payouts-&gt;num_rows ?&gt;" />
  <p>&lt;input type="submit" value="Pay Requests" /&gt;&lt;/p>
  &lt;?=form_close()?&gt;
&lt;? else: ?&gt;
  No pending payouts.
&lt;? endif; ?&gt;

MODEL PAGE

Code:
function GetPaymentRequests() {
    $this->db->select('users.*, payouts.amount, payouts.id as payout_id');
    $this->db->from('payouts');
    $this->db->join('users','payouts.user_id = users.id','INNER');
    $this->db->where('date_paid','0');
    $this->db->where('organization_id',0);
    $this->db->orderby('date_requested ASC');
    $query = $this->db->get();
    return $query->result_array();
  }

CONTROLLER PAGE

Code:
function payment_requests() {
    $data2 = array('payouts'=>$this->mdlUser->GetPaymentRequests());

    $data = array('page_title'=>'Activate New Users',
                  'left_col'=>$this->load->view('nav',0,true),
                  'right_col'=>$this->load->view('users/payment_requests',$data2,true));

    $this->load->view('index', $data);
  }

  function payment_requests_process() {
    for($i=1;$i<=$_POST['num_payouts'];++$i) {
      $this->db->where('id',$_POST['payout'.$i]);
      $this->db->update('payouts',array('date_paid'=>date('Y-m-d')));
    }

I don't think I missed anything. By the way, I am a newbie CodeIgniter and did not create this site. Any help would be appreciated. Thanks in advance.

-Bob


Messages In This Thread
View providing no results, but table has recent entries - by El Forum - 10-02-2009, 11:37 AM
View providing no results, but table has recent entries - by El Forum - 10-02-2009, 11:59 AM
View providing no results, but table has recent entries - by El Forum - 10-02-2009, 12:03 PM
View providing no results, but table has recent entries - by El Forum - 10-02-2009, 12:39 PM
View providing no results, but table has recent entries - by El Forum - 10-02-2009, 12:56 PM
View providing no results, but table has recent entries - by El Forum - 10-02-2009, 01:53 PM
View providing no results, but table has recent entries - by El Forum - 10-02-2009, 02:03 PM
View providing no results, but table has recent entries - by El Forum - 10-02-2009, 02:05 PM
View providing no results, but table has recent entries - by El Forum - 10-02-2009, 02:21 PM
View providing no results, but table has recent entries - by El Forum - 10-06-2009, 02:01 PM
View providing no results, but table has recent entries - by El Forum - 10-06-2009, 02:02 PM
View providing no results, but table has recent entries - by El Forum - 10-06-2009, 02:44 PM
View providing no results, but table has recent entries - by El Forum - 10-06-2009, 11:21 PM
View providing no results, but table has recent entries - by El Forum - 10-07-2009, 12:52 PM
View providing no results, but table has recent entries - by El Forum - 10-07-2009, 01:34 PM
View providing no results, but table has recent entries - by El Forum - 10-07-2009, 02:55 PM
View providing no results, but table has recent entries - by El Forum - 10-07-2009, 09:54 PM
View providing no results, but table has recent entries - by El Forum - 10-08-2009, 11:09 AM
View providing no results, but table has recent entries - by El Forum - 10-08-2009, 11:39 AM
View providing no results, but table has recent entries - by El Forum - 10-08-2009, 12:19 PM
View providing no results, but table has recent entries - by El Forum - 10-08-2009, 12:29 PM
View providing no results, but table has recent entries - by El Forum - 10-08-2009, 12:42 PM
View providing no results, but table has recent entries - by El Forum - 10-08-2009, 12:44 PM
View providing no results, but table has recent entries - by El Forum - 10-08-2009, 12:48 PM
View providing no results, but table has recent entries - by El Forum - 10-09-2009, 12:06 AM
View providing no results, but table has recent entries - by El Forum - 10-09-2009, 03:47 AM
View providing no results, but table has recent entries - by El Forum - 10-09-2009, 04:14 AM
View providing no results, but table has recent entries - by El Forum - 10-09-2009, 11:36 AM
View providing no results, but table has recent entries - by El Forum - 10-19-2009, 02:15 PM
View providing no results, but table has recent entries - by El Forum - 10-20-2009, 02:35 PM
View providing no results, but table has recent entries - by El Forum - 10-20-2009, 02:49 PM
View providing no results, but table has recent entries - by El Forum - 10-20-2009, 11:44 PM
View providing no results, but table has recent entries - by El Forum - 10-21-2009, 01:16 AM
View providing no results, but table has recent entries - by El Forum - 10-21-2009, 09:41 AM
View providing no results, but table has recent entries - by El Forum - 10-22-2009, 02:59 PM
View providing no results, but table has recent entries - by El Forum - 10-22-2009, 03:09 PM
View providing no results, but table has recent entries - by El Forum - 10-22-2009, 10:55 PM
View providing no results, but table has recent entries - by El Forum - 10-23-2009, 05:44 AM
View providing no results, but table has recent entries - by El Forum - 10-23-2009, 09:57 AM
View providing no results, but table has recent entries - by El Forum - 10-23-2009, 10:13 AM
View providing no results, but table has recent entries - by El Forum - 10-23-2009, 01:50 PM
View providing no results, but table has recent entries - by El Forum - 10-23-2009, 02:04 PM
View providing no results, but table has recent entries - by El Forum - 10-28-2009, 01:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB