Solved

Insert question

Posted on 2003-12-08
4
283 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
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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.

726 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