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
View As User
#22
$query=$db->query("Select * from users where id = ?", array($uid));
Then since you are only expecting one result you do

$results = $query->first();

The deal with the question marks in the queries is a security feature that forces it to only look in that one column for the information and stops people from doing some hackery type things.

If your query was expecting multiple results then you would switch out the word first for results.

If you are searching for multiple things you just put a? After each one and then put a comma between every variable in the array
  Reply


Messages In This Thread
View As User - by Brandin - 11-10-2016, 09:03 PM
View As User - by mudmin - 11-11-2016, 09:44 PM
View As User - by Brandin - 11-11-2016, 10:16 PM
View As User - by Brandin - 11-12-2016, 12:24 AM
View As User - by mudmin - 11-14-2016, 04:27 PM
View As User - by Brandin - 11-14-2016, 05:52 PM
View As User - by mudmin - 11-14-2016, 06:30 PM
View As User - by Brandin - 11-14-2016, 08:03 PM
View As User - by mudmin - 11-14-2016, 08:06 PM
View As User - by Brandin - 11-22-2016, 11:18 PM
View As User - by mudmin - 11-23-2016, 12:19 AM
View As User - by Brandin - 11-24-2016, 02:52 AM
View As User - by mudmin - 11-24-2016, 03:46 PM
View As User - by Brandin - 11-24-2016, 04:23 PM
View As User - by Brandin - 11-24-2016, 04:50 PM
View As User - by mudmin - 11-24-2016, 04:50 PM
View As User - by mudmin - 11-24-2016, 05:28 PM
View As User - by Brandin - 11-24-2016, 07:55 PM
View As User - by mudmin - 11-24-2016, 08:28 PM
View As User - by mudmin - 11-24-2016, 08:28 PM
View As User - by Brandin - 11-24-2016, 08:52 PM
View As User - by dan - 11-24-2016, 09:03 PM
View As User - by Brandin - 11-24-2016, 09:44 PM
View As User - by mudmin - 11-24-2016, 10:49 PM
View As User - by Brandin - 11-25-2016, 03:09 PM
View As User - by mudmin - 11-25-2016, 03:31 PM
View As User - by Brandin - 11-25-2016, 04:00 PM
View As User - by Brandin - 01-12-2017, 10:52 PM
View As User - by Brandin - 01-12-2017, 10:53 PM
View As User - by Brandin - 03-19-2017, 11:46 PM
View As User - by mudmin - 03-20-2017, 11:24 AM
View As User - by Brandin - 03-20-2017, 11:28 AM
View As User - by mudmin - 03-23-2017, 10:05 AM
View As User - by Brandin - 03-23-2017, 11:24 AM
View As User - by mudmin - 03-23-2017, 11:30 AM

Forum Jump:


Users browsing this thread: 7 Guest(s)