?
Solved

Insert question

Posted on 2003-12-08
4
Medium Priority
?
285 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

Technology Partners: 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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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 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 …
Suggested Courses

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