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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

752 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