CodeIgniter Forums
Old CI install, recently upgraded PHP and MySQL, and now one query doesn’t work... - 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: Old CI install, recently upgraded PHP and MySQL, and now one query doesn’t work... (/showthread.php?tid=17848)

Pages: 1 2 3 4 5


Old CI install, recently upgraded PHP and MySQL, and now one query doesn’t work... - El Forum - 04-17-2009

[eluser]Bob Puzld[/eluser]
Hi, I am reposting this because I still have no answers. 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. Additional info to follow. 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.’
‘.$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;” >
&lt;input type=“submit” value=“Pay Requests” /&gt;&lt;/p>
&lt;?=form_close()?&gt;
&lt;? else: ?&gt;
No pending payouts.
&lt;? endif; ?&gt;


Old CI install, recently upgraded PHP and MySQL, and now one query doesn’t work... - El Forum - 04-17-2009

[eluser]Bob Puzld[/eluser]
Also, I did a var_dump on the Payment Requests page and this is what it shows.

array(0) {
}


Old CI install, recently upgraded PHP and MySQL, and now one query doesn’t work... - El Forum - 04-17-2009

[eluser]sophistry[/eluser]
turn on error reporting.

also, if you post more code, please use code blocks - raw code give me headache.


Old CI install, recently upgraded PHP and MySQL, and now one query doesn’t work... - El Forum - 04-17-2009

[eluser]Bob Puzld[/eluser]
Does error reporting have to be turned on, on the server?


Old CI install, recently upgraded PHP and MySQL, and now one query doesn’t work... - El Forum - 04-17-2009

[eluser]sophistry[/eluser]
to be able to see if you are actually working with the CI database query object...num_rows() method needs a valid query object. if error reporting is off you won't get the error.


Old CI install, recently upgraded PHP and MySQL, and now one query doesn’t work... - El Forum - 04-17-2009

[eluser]Bob Puzld[/eluser]
Ok. So, error reporting is turned on, on the server end right?


Old CI install, recently upgraded PHP and MySQL, and now one query doesn’t work... - El Forum - 04-17-2009

[eluser]sophistry[/eluser]
see any errors?


Old CI install, recently upgraded PHP and MySQL, and now one query doesn’t work... - El Forum - 04-17-2009

[eluser]Bob Puzld[/eluser]
No errors, just array(0) { }


Old CI install, recently upgraded PHP and MySQL, and now one query doesn’t work... - El Forum - 04-17-2009

[eluser]sophistry[/eluser]
var dump $payouts->result() and see what you get


Old CI install, recently upgraded PHP and MySQL, and now one query doesn’t work... - El Forum - 04-17-2009

[eluser]elvix[/eluser]
You could also take a look at the query itself, probably located in the controller, and echo out a $this->db->last_query() right after it to see what's being sent to the DB.