CodeIgniter Forums
Do I need to upgrade my version of CodeIgniter? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Do I need to upgrade my version of CodeIgniter? (/showthread.php?tid=17034)

Pages: 1 2 3 4


Do I need to upgrade my version of CodeIgniter? - El Forum - 03-24-2009

[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;


Do I need to upgrade my version of CodeIgniter? - El Forum - 03-24-2009

[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.


Do I need to upgrade my version of CodeIgniter? - El Forum - 03-24-2009

[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.


Do I need to upgrade my version of CodeIgniter? - El Forum - 03-24-2009

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


Do I need to upgrade my version of CodeIgniter? - El Forum - 03-24-2009

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


Do I need to upgrade my version of CodeIgniter? - El Forum - 03-24-2009

[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.


Do I need to upgrade my version of CodeIgniter? - El Forum - 03-24-2009

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


Do I need to upgrade my version of CodeIgniter? - El Forum - 03-24-2009

[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...


Do I need to upgrade my version of CodeIgniter? - El Forum - 03-27-2009

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


Do I need to upgrade my version of CodeIgniter? - El Forum - 03-27-2009

[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.