473,734 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't resolve mysql error

7 New Member
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',ecomme rce='O',reselle r='-',dedicated='-',vps='x',affil iate='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 1908
chaarmann
785 Recognized Expert Contributor
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 Recognized Expert Specialist
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
jwgrafflin
7 New Member
Yep. You nailed it. Changed the field name and it works just fine.

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

Ronald
Mar 27 '08 #5
chaarmann
785 Recognized Expert Contributor
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 Recognized Expert Specialist
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
32233
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 the needed documenatation to configure inithsodbc.ora,listener.ora,tnsnames.ora and related errors Here is what it says ORA-12154: SQL> select * from all_catalog@demo;
0
2890
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
2489
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 enclosed in `<' and `>'). SEND-PR: From: dtutanes To: mysql@lists.mysql.com Subject:
4
3022
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 message is: java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused I'm using mysql-standard-4.0.14 and able to get in the mysql server by typing: bin/mysql -uroot -ptest
3
17808
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 server through socket /var/lib/mysql/mysql.sock On the website of MySQL this error is mentioned but I found no solution. In /var/log/messages the following log occurs :
1
121534
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 alpha) so I deinstall mysql5-server and mysql5-client And then I install mysql41-server and mysql41-client on FreeBSD 5.3 by ports but now , mysql is not workable
2
3597
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 on how to resolve the stack trace. Resolved stack trace is much more helpful in diagnosing the problem, so please do resolve it Trying to get some variables. Some pointers may be invalid and cause the dump to abort...
6
2783
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 misspelled the field name, or the field may have been renamed or deleted." The above error is returned when running the following click code. I don't understand what the error means. Private Sub CopyMySQLbttn_Click() On Error GoTo...
3
3193
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 symbol : class device location: class devtestdrive device d1=new tv(); ^ devtestdrive.java:5: cannot resolve symbol symbol : class tv
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
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,...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9182
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
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...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
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...

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.