The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (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
Trouble with DB results
#1
Hello.

First let me say that I haven't messed around with PHP for quite some time. I used to be fairly good with the language around 10 years ago but stopped programming until recently again.

I love how you made a pretty nice user system here and I thank you for that.

I am having trouble with getting results from the query though... Here is what the page looks like.

[Image: 1.png]

and here is the code I have...

[Image: 2.png]

I tried doing mysql_num_rows but I couldn't get a count on the rows that way either.


Any help would be of great help.

Thank you!
  Reply
#2
It's been a little while since I've used the count method, so I had to confirm. I put a method in the db class that does this for you. You can do something like this.

Code:
$query = $db->query("SELECT * from users");
Code:
$count = $db->count();
Code:
echo $count;

You can also see that kind of coding in action at the top of the admin panel. I hope that helps.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)