• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 115
  • Last Modified:

Trying to create a variable's value, but getting error instead...

Hi,
Trying to create a variable value to use further down in my code. I'm not sure how to express this properly. Currently I get an error:
Syntax error, unexpected ','
How do I get around that?
$sortby = DB::raw('used_vehicles.vehicle_price - used_vehicles.discount'), 'ASC';

Open in new window

0
tjyoung
Asked:
tjyoung
  • 2
  • 2
1 Solution
 
Ray PaseurCommented:
Maybe try this... Moved closing parenthesis:
$sortby = DB::raw('used_vehicles.vehicle_price - used_vehicles.discount', 'ASC');

Open in new window

0
 
tjyoungAuthor Commented:
Geez I suck lol
Thanks again Ray :)
0
 
Ray PaseurCommented:
J' Welcome!  I have those moments, too, when I look at something and just can't see it.  Glad to help out :-)
0
 
tjyoungAuthor Commented:
Issue is fixed. Thanks again.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now