473,385 Members | 1,312 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,385 software developers and data experts.

Problem with MySQL UPDATE

1
PHP version 4.4.4
MySQL Version 4.1.21

There is a problem in this code:

Expand|Select|Wrap|Line Numbers
  1. ....
  2. $sql = 'UPDATE Msg2Ptg hdr="Test", dt1="09.08.2007 10:32:14 ", About="xxx " limit 1';
  3. mysql_query($sql) or die ('Error on UPDATE:<br>' . mysql_error());

This cause next message:

Error on UPDATE:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '="Test", dt1="09.08.2007 10:32:14 ", About="xxx " limit 1' at line 1


Thanks in advance for any help
Sep 7 '07 #1
1 1087
Atli
5,058 Expert 4TB
Hi Stoyan. Welcome to TSDN!

Your UPDATE query is missing the SET keyword. It should look more like this:
Expand|Select|Wrap|Line Numbers
  1. UPDATE Msg2Ptg 
  2. SET 
  3.   hdr="Test", 
  4.   dt1="09.08.2007 10:32:14 ", 
  5.   About="xxx " 
  6. limit 1
  7.  
Sep 7 '07 #2

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

Similar topics

2
by: Harald Servat Gelabert | last post by:
Dear news-team I'm using MySQL 4.0.15a (with PHP 4.3.4rc1 and Apache 2.0.47 under FreeBSD). I'm having problems when updating a column of a table (it updates an extra column). As an...
12
by: Mosher | last post by:
Hi all, I have an issue with php and/or mysql. I have a php form that writes "items" to a mysql database, including a description of the item. On the mysql server, "magic_quotes_gpc" is ON. I...
1
by: Jordy | last post by:
Environment: Sun servers running solaris 2.8 Php 4.3.6 Apache 1.3.29 Mysql 4.1.1 phpMyAdmin 2.6.0-alpha1 phpAds 2.0 PhpMyadmin and phpAds don't succeed to connect the MySql database when
0
by: Peter Fleck | last post by:
I'm having some trouble updating a mysql database with a perl cgi. Here's the perl: $sql = "UPDATE grants SET agency2 = \"$agency2\" WHERE agency2 = \"$key\""; $rv = do($sql) or die "Can't...
0
by: Tiffany Wilkes | last post by:
I solved the problem--I needed ( ) around the column list. I think the manual should make that more clear. -------- Original Message -------- Subject: column privilege problem Date: Tue, 05...
0
by: hiisikukko | last post by:
I have created project management software with Java and MySql and i works fine. This applet gets and writes information directly to MySql database. Problem is that those sqlClauses below(update...
0
by: jwl | last post by:
I'm having a problem with a bit of code that I have "adopted". It was partially complete when I took it over. The function of the code is to read a log file, locate files described in that log...
9
by: zMisc | last post by:
When I try to update record, I kept getting this error: Row cannot be located for updating. Some values may have been changed since it was last read. No other users are accessing the database...
3
by: Juan Antonio Villa | last post by:
Hello, I'm having a problem replicating a simple database using the binary log replication, here is the problem: When the master sends an update to the slave, an example update reads as follows:...
6
Atli
by: Atli | last post by:
This is an easy to digest 12 step guide on basics of using MySQL. It's a great refresher for those who need it and it work's great for first time MySQL users. Anyone should be able to get...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.