Closed ezetojo closed 6 years ago
@ezetojo https://github.com/ThreeLetters/SuperSQL/blob/master/SuperSQL/helper.php#L182
The get
method is only available for the helper class. To use the helper class, just replace the new SuperSQL\SuperSQL(/* args */)
to new SuperSQL\SQLHelper(/* args */)
In addition, you must have it included by using this file. Or, you can also use this smaller file, which has everything, so you do not need two files.
@ezetojo Also, it is not recommended to use the get
method. You can use this instead, and it will have better performance. This is because the get method gets all the rows (If your database does not support LIMIT such as SQL Server or MSAccess), and then selects one, but if you use this syntax, only the first row will be retrieved from the server.
$dt = $db->select("users", ["*"], ["id"=>"oeid389hdjwsjhd"], null, 1); // Query only 1 row
$first = $dt[0]; // Only get first row (Even when LIMIT is not supported), When you use this, only the first row is retrieved - So it is really fast.
Thank you @Andrews54757. I'll try.
Call to undefined method SuperSQL\SuperSQL::get()