hi im having a problem in saving data in my database and i try everything i know but still im having this error message in my page..please help me thanks guys -
<?php
-
/*$cs = mysql_connect ('localhost')or die ("not connect .". mysql_error());
-
$ds = mysql_select_db ('dbase')or die ("no data .". mysql_error());
-
-
$host = 'localhost';
-
$username = 'globaml6';
-
$password = 'Gwd_2011';
-
-
$conn = mysql_connect($host, $username, $password) or die('Error connecting to mysql');
-
-
$dbname = 'globaml6_gwd';
-
mysql_select_db($dbname);
-
*/
-
$dbhost = 'localhost';
-
$dbuser = 'root';
-
$dbpass = '';
-
-
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
-
-
$dbname = 'msic';
-
mysql_select_db($dbname);
-
-
-
-
-
$sql="INSERT INTO sd (Pickday, Pickmonth, Pickhour, Pickmin, Rday, Rmonth, Rhour, Rmin, Origin, Destination, Vehicle, Fname, Lname, Email, Contact, Address, Zip, City, Country)
-
VALUES ('".$_POST['txtpday']."', '".$_POST['txtpmonth']."', '".$_POST['txtphr']."', '".$_POST['txtpmin']."', '".$_POST['txtrday']."', '".$_POST['txtrmonth']."', '".$_POST['txtrhr']."', '".$_POST['txtrmin']."', '".$_POST['txtorigin']."', '".$_POST['txtdestination']."', '".$_POST['txtvehicle']."', '".$_POST['txtfname']."', '".$_POST['txtlname']."', '".$_POST['txtemail']."', '".$_POST['txtcontact']."', '".$_POST['txtadd']."', '".$_POST['txtzip']."', '".$_POST['txtcity']."', '".$_POST['txtcountry']);
-
-
-
-
-
if (!mysql_query($sql,$conn))
-
{
-
die('Error: ' . mysql_error());
-
}
-
header("location:index.html");
-
-
-
mysql_close($conn)
-
-
-
/*
-
$result=mysql_query($sql);
-
echo $sql;
-
echo $result;
-
*/
-
?>
-
-
this is the error
Parse error: syntax error, unexpected ')' in C:\xampp\htdocs \msicweb\sdsave .php on line 27
3 1942 Luuk 1,047
Recognized Expert Top Contributor
Look a the code below, and try to understand what it does,
After understanding the quotes, you will know how to change your code: - <?php
-
$nl="<br>".PHP_EOL;
-
print 'This will only print the letter t: t'.$nl;
-
print 'This will print the letter t followed by a single-quoot: t\''.$nl;
-
print "This will print a single-quoot: '".$nl;
-
print "This will print two single-quotes: ''".$nl;
-
print 'This will print one single-quote: \''.$nl;
-
print 'This should print two single-quotes: \'\''.$nl;
-
print 'This will print a double-quoot: "'.$nl;
-
print "This will also print a double-quoot: \"".$nl;
-
?>
-
luuk can you help me pinpoint where is my error cause i already scan my code a couple of times but i still cant get it..
Luuk 1,047
Recognized Expert Top Contributor
the end of line 27: - '".$_POST['txtcountry']);
change it to : - '".$_POST['txtcountry'].")";
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Mike Thomas |
last post by:
This one must be very simple. I am trying to run an SQL Serv 7.0 stored
proc
from a VBA module in an Access 2000 app. This stored proc runs fine when I
remove the parameters from the stored proc and from the CommandText string
below, but when I run it as is I get the error
SQL Serv Syntax Error or Access Violation
on the "Execute" line. _ContactFetchLike 'Thom%' also works when I run it
from the Query Analyser.
|
by: Nathan Sokalski |
last post by:
When trying to submit data to an Access database using ASP.NET I recieve the
following error:
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
+41
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult) +174
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
+92
|
by: r.nikhilk |
last post by:
Hi,
Currently, we are porting C++ applications from 32 bit to 64 bit on AIX
platform. (The current version of AIX is 5.3 and xlC verison is 8.0).
We are able to compile the applications by including the -q64 option in
xlC compiler. And we are able to link all these libraries to one of
the main applications and generate an executable. SKLoader. But, when
we try to run this main executable, we are getting the following
errors:
|
by: technocraze |
last post by:
Hi guys,
I have encountered this error when updating the values to the MS Acess table.
Error : Update on linked table failed. ODBC sql server error Timeout expired. MS Acess is my front end and sql server is my backend server.
This error occured whenever i step through and when it reaches rs.update it jux hangs down there and thereafter it shwn the aforementioned error. I am using the RecordSet properties to add the values. Can I use...
|
by: Shrutisinha |
last post by:
I am getting this error in unix ..
syntax error near unexpected token `('
when i am running my parser , can anybody help me plzz .. i am new to all this
thanks
| |
by: sudhanshu |
last post by:
Hi friends,
I am facing this error in my vb 6.0 code.
The code is...
Dim conn As New ADODB.Connection
Dim cmd As New ADODB.Command
Private Sub cmdOK_Click()
|
by: nickyeng |
last post by:
i calling this piece of java code in jsp :
List<Customer> list = Customer.listby_page(currentRs);
...
...
then it gives me the following error:
|
by: charith |
last post by:
Hi All,
I get this error very frequently
syntax error
() in frequently calling a servlets and html files also
In the response of the makeRequest is this way
"body":"","rc":"504"
When clicked on the error displayed in firebug,it redirects to a js
file
line 186 >>
|
by: mideastgirl |
last post by:
I keep getting this error and I cannot figure it out. My curly brackets are closed, and I am using the correct tags for <?php to open and ?> to close my code. Can someone please help me!
Here is my code:
<?php
//Connect To Database
$hostname='mideasthonors2.db.4381361.hostedresource.com';
$username='**************';
$password='***********';
$dbname='mideasthonors2';
|
by: rahul more |
last post by:
Hiiii I am making my project in VB6.0 and my back end is Access 2003. I hav one problem.....
When I going to save data into database, at at cmdSave_Click event, VB giving me error(Error mentioned at heading)after clicking on SAVE button and Highlighting the statement which are as follows.....
rs.Open "Insert into addclasses (Batch, BatchTime, Std, CollYear, SchlBtchName, CollBtchName, BatchType, SchlSubjct ,CollSubjct, Teacher, Days,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |