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

Posted on 2016-09-11
Medium Priority
Last Modified: 2016-09-12
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

Question by:tjyoung
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 111

Accepted Solution

Ray Paseur earned 2000 total points
ID: 41793532
Maybe try this... Moved closing parenthesis:
$sortby = DB::raw('used_vehicles.vehicle_price - used_vehicles.discount', 'ASC');

Open in new window


Author Closing Comment

ID: 41793533
Geez I suck lol
Thanks again Ray :)
LVL 111

Expert Comment

by:Ray Paseur
ID: 41793535
J' Welcome!  I have those moments, too, when I look at something and just can't see it.  Glad to help out :-)

Author Comment

ID: 41793968
Issue is fixed. Thanks again.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question