Solved

Insert question

Posted on 2003-12-08
4
284 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 500 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

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…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to count occurrences of each item in an array.
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…

717 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