Solved

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

Posted on 2016-09-11
4
34 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
  • 2
  • 2
4 Comments
 
LVL 108

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 108

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now