Solved

PHP Quotes

Posted on 2012-04-01
3
280 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 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
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
Comment Utility
Awesome, thanks!
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
You're welcome!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

743 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

8 Experts available now in Live!

Get 1:1 Help Now