473,382 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Can't resolve mysql error

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.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $hostname=$_POST['hostname'];
  3. $url=$_POST['url'];
  4. $established=$_POST['established'];
  5. $price=$_POST['price'];
  6. $diskspace=$_POST['diskspace'];
  7. $bandwidth=$_POST['bandwidth'];
  8. $econplan=$_POST['econplan'];
  9. $maillists=$_POST['maillists'];
  10. $platform=$_POST['platform'];
  11. $ssl=$_POST['ssl'];
  12. $ecommerce=$_POST['ecommerce'];
  13. $reseller=$_POST['reseller'];
  14. $dedicated=$_POST['dedicated'];
  15. $vps=$_POST['vps'];
  16. $affiliate=$_POST['affiliate'];
  17. $green=$_POST['green'];
  18. $au=$_POST['au'];
  19. $ca=$_POST['ca'];
  20. $uk=$_POST['uk'];
  21. $notes=$_POST['notes'];
  22.  
  23. include("dbinfo.inc.php");
  24.  
  25. $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'";
  26. @mysql_select_db($database) or die( "Unable to select database" . mysql_error());
  27. mysql_query($query) or die("Unable to update data" . mysql_error());
  28. echo "<center><table><tr><td>";
  29. echo "<h2>Record Updated</h2>";
  30. echo "</td></tr></table></center>";
  31. mysql_close();
  32. ?>
  33.  
Mar 26 '08 #1
6 1887
chaarmann
785 Expert 512MB
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.
Mar 26 '08 #2
ronverdonk
4,258 Expert 4TB
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
Mar 27 '08 #3
Yep. You nailed it. Changed the field name and it works just fine.

Thanks.
Mar 27 '08 #4
ronverdonk
4,258 Expert 4TB
I knew I would. Glad it is solved. See you around.

Ronald
Mar 27 '08 #5
chaarmann
785 Expert 512MB
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?
Mar 29 '08 #6
ronverdonk
4,258 Expert 4TB
SSL is a reserved word starting with MySQL version 4.0. Maybe the other site ran a MySQL version < 4.0.

See MySQL 3.23, 4.0 and 4.1 Reserved words

Ronald
Mar 29 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

5
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...
0
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).
0
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...
4
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...
3
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...
1
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...
2
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...
6
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...
3
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...
0
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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...
0
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
0
BarryA
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...
1
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...
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.