Solved

PHP Quotes

Posted on 2012-04-01
3
293 Views
Last Modified: 2012-04-01
This is very frustrating for me, but I have the following query and it will not add the date field since there are not quotes around it.  Regardless of how I structure the quotes, the dang page will not load properly due to encapsulated quotes.


$sql_fields = "'.$date.'", "'.$directions.'", "'.$video.'", "'.$videolink.'", "'.$totalquestions.'", "'.$totalinputs.'", "'.$dateadded.'", "'.$addedby.'";
0
Comment
Question by:t3chguy
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 37793932
That maybe the data but that's not the whole query.  Since your start and end quotes are double quotes, you don't need to use the '.' syntax to include variables.  This is what I would do with that data:

$sql_fields = "'$date', '$directions', '$video', '$videolink', '$totalquestions', '$totalinputs', '$dateadded', '$addedby'";
0
 
LVL 1

Author Closing Comment

by:t3chguy
ID: 37793936
Awesome, thanks!
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 37794016
You're welcome!
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

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…
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…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

713 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