Solved

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

Posted on 2016-09-11
4
85 Views
Last Modified: 2016-09-12
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
Comment
Question by:tjyoung
[X]
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
4 Comments
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 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

0
 
LVL 1

Author Closing Comment

by:tjyoung
ID: 41793533
Geez I suck lol
Thanks again Ray :)
0
 
LVL 110

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 :-)
0
 
LVL 1

Author Comment

by:tjyoung
ID: 41793968
Issue is fixed. Thanks again.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
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 dynamically set the form action using jQuery.

726 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