The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PDO newbie loop question
#1
Hi
i'm totally new with PDO but i'm thinking it might be good to reuse the userspice connection. so if anyone could give a hint in how i loop out the data i got with below query i would be grateful.

Code:
$clist = DB::getInstance()->query("SELECT * FROM company")
Code:
echo $clist->count()
works just fine but i cant figure out how get that to a foreach or while loop...
Code:
foreach ($clist as $row) {echo $row["xyz"];}
does not work...
  Reply


Messages In This Thread
PDO newbie loop question - by palmeros - 11-10-2016, 06:24 AM
PDO newbie loop question - by palmeros - 11-10-2016, 10:24 AM
PDO newbie loop question - by mudmin - 11-10-2016, 01:07 PM
PDO newbie loop question - by palmeros - 11-10-2016, 01:14 PM
PDO newbie loop question - by mudmin - 11-12-2016, 12:08 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)