php - missing values in table generated from database query -
php - missing values in table generated from database query -
i created table in mysql 1 item in it, copied php page on site pulling database , tried modify pull 'gigs' table. it's not working , i'm close going insane :)
here's php:
<div class="span12"> <h3>view & manage gigs</h3> <table class="table table-striped"> <tr> <th>gig id</th> <th>gig name</th> <th>customer</th> <th>date</th> <th>fee</th> <th>status</th> <th>manage</th> </tr> <?php $cnt = orm::for_table('gigs')->where('gid', $cid)->count(); if ($cnt>0){ $items = orm::for_table('gigs')->raw_query($query)->find_many(); $i='0'; foreach ($items $item) { $i++; $gigid = $item['gigid']; $gig_name = $item['gig_name']; $gig_customer = $item['gig_customer']; $gig_date = $item['gig_date']; $gig_fee = $item['gig_fee']; $status = $item['gig_status']; if ($status=='booked'){ $st="<a class=\"btn btn-danger btn-small\" href=\"invoice$ext?_cmd=$gigid\">".$_l['pay_now']."</a>"; } else { $st="<a class=\"btn btn-primary btn-small\" href=\"invoice$ext?_cmd=$gigid\">".$_l['view']."</a>"; } $ext = ext; echo "<tr> <td>$gigid</td> <td>$gig_name</td> <td>$gig_customer</td> <td>$gig_date</td> <td>$gig_fee</td> <td>$status</td> <td>$st</td> </tr>"; } } ?> </table> <?php echo $paginate['contents']; ?> </div>
when view source on page, creating table headings, td doesn't created , of course of study there no info showing - headings..
any ideas?
error reporting gave me:
fatal error: uncaught exception 'pdoexception' message 'sqlstate[42s22]: column not found: 1054 unknown column 'gid' in 'where clause'' in /home/content/s/t/o/stolzillusions/html/gigs/lib/d.f.php:387 stack trace: #0 /home/content/s/t/o/stolzillusions/html/gigs/lib/d.f.php(387): pdostatement->execute(array) #1 /home/content/s/t/o/stolzillusions/html/gigs/lib/d.f.php(1539): orm::_execute('select count(*)...', array, 'default') #2 /home/content/s/t/o/stolzillusions/html/gigs/lib/d.f.php(549): orm->_run() #3 /home/content/s/t/o/stolzillusions/html/gigs/lib/d.f.php(658): orm->find_one() #4 /home/content/s/t/o/stolzillusions/html/gigs/lib/d.f.php(610): orm->_call_aggregate_db_function('count', '*') #5 /home/content/s/t/o/stolzillusions/html/gigs/cp/views/bmsapp/gig-list.tpl.php(19): orm->count() #6 /home/content/s/t/o/stolzillusions/html/gigs/cp/gig-list.php(4): require('/home/content/s...') #7 {main} thrown in /home/content/s/t/o/stolzillusions/html/gigs/lib/d.f.php on line 387`
you haven't set value $query variable or missing something?
php
Comments
Post a Comment