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
$db->query not returning records
#5
Two things.

You should be binding your variables.

Code:
$project_get = $db->query("SELECT * FROM apps_project WHERE token = ?",($project_token));

Second thing, you are making $project_get_id a full array, not just one result. If you want one line, use
Code:
first()
instead of results(). If you want to use
Code:
results()
and obtain more than one line, you will need to foreach.

Code:
foreach ($project_get->results() as $project_get_id) { $this_id = $project_get_id->id; }

Note this is going to overwrite the $this_id variable if you use it outside of the foreach
  Reply


Messages In This Thread
$db->query not returning records - by eer3 - 10-10-2017, 08:31 PM
$db->query not returning records - by eer3 - 10-10-2017, 11:36 PM
$db->query not returning records - by Brandin - 10-11-2017, 09:04 AM
$db->query not returning records - by Brandin - 10-16-2017, 04:46 PM
$db->query not returning records - by karsen - 10-16-2017, 05:23 PM
$db->query not returning records - by Brandin - 10-18-2017, 11:05 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)