I keep getting the same error:
Unable to update dataYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl='O',ecommerce='O',reseller='-',dedicated='-',vps='x',affiliate='CJ',green='-' at line 1
This code works just fine on another site, and all the other php pages work just fine. But this one is driving me nuts trying to figure out the problem. -
<?php
-
$hostname=$_POST['hostname'];
-
$url=$_POST['url'];
-
$established=$_POST['established'];
-
$price=$_POST['price'];
-
$diskspace=$_POST['diskspace'];
-
$bandwidth=$_POST['bandwidth'];
-
$econplan=$_POST['econplan'];
-
$maillists=$_POST['maillists'];
-
$platform=$_POST['platform'];
-
$ssl=$_POST['ssl'];
-
$ecommerce=$_POST['ecommerce'];
-
$reseller=$_POST['reseller'];
-
$dedicated=$_POST['dedicated'];
-
$vps=$_POST['vps'];
-
$affiliate=$_POST['affiliate'];
-
$green=$_POST['green'];
-
$au=$_POST['au'];
-
$ca=$_POST['ca'];
-
$uk=$_POST['uk'];
-
$notes=$_POST['notes'];
-
-
include("dbinfo.inc.php");
-
-
$query="UPDATE webhosts SET hostname='$hostname',url='$url',established='$established',price='$price',diskspace='$diskspace',bandwidth='$bandwidth',econplan='$econplan',maillists='$maillists',platform='$platform',ssl='$ssl',ecommerce='$ecommerce',reseller='$reseller',dedicated='$dedicated',vps='$vps',affiliate='$affiliate',green='$green',au='$au',ca='$ca',uk='$uk',notes='$notes' WHERE hostname='$hostname'";
-
@mysql_select_db($database) or die( "Unable to select database" . mysql_error());
-
mysql_query($query) or die("Unable to update data" . mysql_error());
-
echo "<center><table><tr><td>";
-
echo "<h2>Record Updated</h2>";
-
echo "</td></tr></table></center>";
-
mysql_close();
-
?>
-
6 1887
check your table "webhosts" if it has the column "reseller".
Your code will work on one side and not on the other if the tables "webhosts" are different.
SSL is a reserved word in MySQL, so you cannot use it for a column name. See MySQL 5,0 reserved word
See the approp. documentation for other MySQL versions.
Ronald
Yep. You nailed it. Changed the field name and it works just fine.
Thanks.
I knew I would. Glad it is solved. See you around.
Ronald
SSL is a reserved word in MySQL, so you cannot use it for a column name.
Ronald
I thought about that first, too. But then he wrote "this code works fine on another site". So if it's a reserved word then how was it working "on another site" then? It should also have been crashed there. Maybe different versions?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Subrahmanyam Arya |
last post by:
Dear oracle gurus,
I am unable to get past the error ORA-12154: TNS: could not resolve
service name on my host when using hsodbc to talk to a remote mysql
database. i got from the meta link all...
|
by: Stefan Hinz |
last post by:
Degan,
jumping in to try and solve some problems that look pretty obvious to
me ...
> #options for default service (mysqld2)
> (mysqld2)
It should be , not (mysqld2).
|
by: Dennis Francis B. Tutanes |
last post by:
$B$*@$OC$K$J$C$F$*$j$^$9!#(B
$B%D%?%M%9(B@TSTI$B$G$9!#(B
SEND-PR: -*- send-pr -*-
SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
SEND-PR: will all comments (text...
|
by: Denis Labon |
last post by:
I can't connect to mysql server using the mysql-connector-java-3.0.11.
I was able to run the same program when I was running Suse 9.0 but
since I install Suse 9.1, I can't connect.
The error...
|
by: Pugi! |
last post by:
On a freshly installed Fedora C3 (incl. webserver apache php mysql) i get
the following problem when connecting to mysql through a browser
(phpMyAdmin):
:
#2002 Can't connect to local MySQL...
|
by: jiing |
last post by:
Now let me describe what I have done and my purpose:
Originally, I want to user ports to install phpBB
But I found that phpBB doesn't support mysql 5.x (but the ports
installed mySQL 5.0.0...
|
by: pratchaya |
last post by:
This is my sample error in my MySQL Log
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://www.mysql.com/doc/en/Using_stack_trace.html and
follow instructions...
|
by: MLH |
last post by:
"The following unexpected error occurred in Sub CopyMySQLbttn_Click,
line #250, CBF on frmVehicleChooserform. 2465: "Can't find the field
'forms' referred to in your expression. You may have...
|
by: Sindhu Rani |
last post by:
i hav created 3 classes in 3 different files. am gettin an error durin compilation. wat shud i do???
C:\s\source>javac -d ..\classes devtestdrive.java
devtestdrive.java:5: cannot resolve symbol...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |