Solved

Insert question

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

708 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

12 Experts available now in Live!

Get 1:1 Help Now