Welcome Guest, Not a member yet? Register   Sign In
Do I need to upgrade my version of CodeIgniter?
#1

[eluser]Bob Puzld[/eluser]
Hi, I am new to codeigniter and am trying to help a friend figure out his web site. His site was originally built with Codeigniter version 1.3. The server was recently upgraded from PHP Version 4.32 to 5.2.6, and MySql from version 3.23 to 5.0.67. Now one of his pages does not display the proper results. The table in the database has many recent entries of people requesting payment, but the page displays... No pending payouts. The code from this page is below. Any help would be appreciated. Thanks.

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

&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;
#2

[eluser]xwero[/eluser]
I don't think you will find some one, other than the EL people, who used 1.3?

But i don't see nothing wrong so i guess the problem is in the database class.
#3

[eluser]jedd[/eluser]
Is it possible the server upgrade to PHP disabled short tags on the way?

You could try forcing them back on using the [url="http://ellislab.com/codeigniter/user-guide/general/alternative_php.html"]dodgy CI approach[/url], just in case.
#4

[eluser]TheFuzzy0ne[/eluser]
Just var_dump the result - see what's up.
#5

[eluser]Phil Sturgeon[/eluser]
See how you feel after a power_dump(). Tongue
#6

[eluser]Jelmer[/eluser]
Take a look at the queries you're using, I had a problem with ordering when I changed servers with an application a while back. It was because of the following:
Code:
$query = $this->db->query('SELECT * FROM table1 ORDER BY "number" DESC LIMIT 0,5');
The problem turned out to be the "-quotes, the newer mySQL version didn't recognize the fieldname until I changed them to `-quotes:
Code:
$query = $this->db->query('SELECT * FROM table1 ORDER BY `number` DESC LIMIT 0,5');

EDIT: Should mention that I also updated the CI version from 1.5.4 to 1.7 during the move, but I don't believe the quotes issue was caused by CI.
#7

[eluser]Bob Puzld[/eluser]
Thanks Jelmer. The queries do have single quotes.
#8

[eluser]TheFuzzy0ne[/eluser]
[quote author="Phil Sturgeon" date="1237926683"]See how you feel after a power_dump(). Tongue[/quote]

I hear that's a great way to start your day...
#9

[eluser]Bob Puzld[/eluser]
Jed, short tags are enabled on the server. Thanks for the response.
#10

[eluser]jedd[/eluser]
Bob, I think the big thing we're waiting on here is for you to do a var_dump (or variation on same) of $payouts, early on in this view.




Theme © iAndrew 2016 - Forum software by © MyBB