Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Insert question

Posted on 2003-12-08
4
Medium Priority
?
287 Views
Last Modified: 2006-11-17
Hello,

I'm new to PHP.

When I run the following code, I get the error below.
$sql = "INSERT INTO service(`s_Name`) VALUES('$s_name');"

if (@mysql_query($sql, $dbcnx)){ <- Line 20
echo('Connected');
}


Parse error: parse error in /home/anudaysp/public_html/process.php on line 20
0
Comment
Question by:Isaac
[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
4 Comments
 
LVL 24

Accepted Solution

by:
shivsa earned 2000 total points
ID: 9900511
change this line
$sql = "INSERT INTO service(`s_Name`) VALUES('$s_name');"
to
$sql = "INSERT INTO service(`s_Name`) VALUES('$s_name')";
0
 
LVL 33

Expert Comment

by:snoyes_jw
ID: 9900529
the $sql statement has the ; inside the quotes.  Move it to after the quotes.

$sql = "INSERT INTO service(`s_Name`) VALUES('$s_name')";
0
 
LVL 33

Expert Comment

by:snoyes_jw
ID: 9900535
bother, should have reloaded the question before posting.
0
 
LVL 5

Author Comment

by:Isaac
ID: 9900563
Thanks Shivsa!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
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

618 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