Search Results

Search found 36111 results on 1445 pages for 'mysql update'.

Page 112/1445 | < Previous Page | 108 109 110 111 112 113 114 115 116 117 118 119  | Next Page >

  • #1366 - Incorrect integer value:MYsql

    - by rajanikant
    hi every one i have a problem in mysql my table is CREATE TABLE IF NOT EXISTS `contactform` ( `contact_id` int(11) NOT NULL AUTO_INCREMENT, `first_name` varchar(50) NOT NULL, `addition` varchar(50) NOT NULL, `surname` varchar(50) NOT NULL, `Address` varchar(200) NOT NULL, `postalcode` varchar(20) NOT NULL, `city` varchar(50) NOT NULL, `phone` varchar(20) NOT NULL, `emailaddress` varchar(30) NOT NULL, `dob` varchar(50) NOT NULL, `howtoknow` varchar(50) NOT NULL, `othersource` varchar(50) NOT NULL, `orientationsession` varchar(20) NOT NULL, `othersession` varchar(20) NOT NULL, `organisation` int(11) NOT NULL, `newsletter` int(2) NOT NULL, `iscomplete` int(11) NOT NULL, `registrationdate` date NOT NULL, PRIMARY KEY (`contact_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=39 ; mysql>insert into contactform values('','abhi','sir','shukla','vbxcvb','342342','asdfasd','234234234','[email protected]','1999/5/16','via vrienden of familie','','19','20','6','1','1','2010-03-29') i get following error. #1366 - Incorrect integer value: '' for column 'contact_id' at row 1 this query work fine on my local machine but give error on server

    Read the article

  • MySql Query lag time / deadlock?

    - by Click Upvote
    When there are multiple PHP scripts running in parallel, each making an UPDATE query to the same record in the same table repeatedly, is it possible for there to be a 'lag time' before the table is updated with each query? I have basically 5-6 instances of a PHP script running in parallel, having been launched via cron. Each script gets all the records in the items table, and then loops through them and processes them. However, to avoid processing the same item more than once, I store the id of the last item being processed in a seperate table. So this is how my code works: function getCurrentItem() { $sql = "SELECT currentItemId from settings"; $result = $this->db->query($sql); return $result->get('currentItemId'); } function setCurrentItem($id) { $sql = "UPDATE settings SET currentItemId='$id'"; $this->db->query($sql); } $currentItem = $this->getCurrentItem(); $sql = "SELECT * FROM items WHERE status='pending' AND id > $currentItem'"; $result = $this->db->query($sql); $items = $result->getAll(); foreach ($items as $i) { //Check if $i has been processed by a different instance of the script, and if so, //leave it untouched. if ($this->getCurrentItem() > $i->id) continue; $this->setCurrentItem($i->id); // Process the item here } But despite of all the precautions, most items are being processed more than once. Which makes me think that there is some lag time between the update queries being run by the PHP script, and when the database actually updates the record. Is it true? And if so, what other mechanism should I use to ensure that the PHP scripts always get only the latest currentItemId even when there are multiple scripts running in parrallel? Would using a text file instead of the db help?

    Read the article

  • MySQL and Matlab

    - by Shaihi
    I want to interact with a MySQL database from Matlab. I found a mysql "library" for matlab here and the same on mathworks. I followed the instructions to compile the library and the compilation seems to be successful. I get a mex32 file at the end. Only, the instructions on the first page refer to a Dll that I need to use (I guess that a Dll was supposed to be generated). I am not familiar with the mex compiler or with compiling external modules for Matlab. Am I missing something trivial? Where is the Dll supposed to be? Thanks.

    Read the article

  • mysql query performance help

    - by Stefano
    Hi I have a quite large table storing words contained in email messages mysql> explain t_message_words; +----------------+---------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------+---------+------+-----+---------+----------------+ | mwr_key | int(11) | NO | PRI | NULL | auto_increment | | mwr_message_id | int(11) | NO | MUL | NULL | | | mwr_word_id | int(11) | NO | MUL | NULL | | | mwr_count | int(11) | NO | | 0 | | +----------------+---------+------+-----+---------+----------------+ table contains about 100M rows mwr_message_id is a FK to messages table mwr_word_id is a FK to words table mwr_count is the number of occurrencies of word mwr_word_id in message mwr_message_id To calculate most used words, I use the following query SELECT SUM(mwr_count) AS word_count, mwr_word_id FROM t_message_words GROUP BY mwr_word_id ORDER BY word_count DESC LIMIT 100; that runs almost forever (more than half an hour on the test server) mysql> show processlist; +----+------+----------------+--------+---------+------+----------------------+----------------------------------------------------- | Id | User | Host | db | Command | Time | State | Info +----+------+----------------+--------+---------+------+----------------------+----------------------------------------------------- processlist | 41 | root | localhost:3148 | tst_db | Query | 1955 | Copying to tmp table | SELECT SUM(mwr_count) AS word_count, mwr_word_id FROM t_message_words GROUP BY mwr_word_id | +----+------+----------------+--------+---------+------+----------------------+----------------------------------------------------- 3 rows in set (0.00 sec) Is there anything I can do to "speed up" the query (apart from adding more ram, more cpu, faster disks)? thank you in advance stefano

    Read the article

  • Need a mysql query to extract data from mm-forms

    - by Kirill
    http://cl.ly/201a11b430bf60ef9e97 is what the rows look like, after I clean them up a bit: SELECT fk_form_joiner_id,form_key,value FROM wp_contactform_submit_data WHERE form_key!='page_post_id' AND form_key!='captcha-802' AND form_key!='page_post_title' AND form_key!='user_ID' What I need is a query where it would transform this into a structure like: id | First-name | Surname-name | your-email | dob | address-1 | address-2 | county | postcode | phone ------------------------------------------------------------------------------------------------------- 88 | jack | Somethin | [email protected] | dob | (etc) I think I know a way to do this through php, but I think there must be a way to do it as a mysql query. Ultimately, I need to export this (into a csv), but if you could give me a query that would output this into a mysql table (or at least a workable select query, that I could then turn into an insert query loop, to create a table), I'd do it form there. Thank you.

    Read the article

  • How to pull data from a MySQL column and put it into a single array

    - by Rob
    Basically, this is what I currently use in an included file: $sites[0]['url'] = "http://example0.com"; $sites[1]['url'] = "http://example1.com"; $sites[2]['url'] = "http://example2.com"; $sites[3]['url'] = "http://example3.com"; $sites[4]['url'] = "http://example4.com"; $sites[5]['url'] = "http://example5.com"; And so I output it like so: foreach($sites as $s) But I want to make it easier to manage via a MySQL database. So my question is, how can I make it automatically add additional "$sites[x]['url'] = "http://examplex.com";" and output it appropriately from my MySQL table?

    Read the article

  • Migrating schema and SP from informix to mysql

    - by zombiegx
    We need to redo a database in MySQL that has been already done on Informix, is there a way to migrate not only the schema, but the stored procedures as well? Thanks. We have a client whom we built a web application that uses an Informix database. Now the client wants to be able to implement the same software but on multiple closed networks (like 20). Doing this using Informix would be very expensive (20 licences X_X). So the best approach is to redo the database on something like MySQL. The application was done using Flex, .Net (using ODBC) and Informix.

    Read the article

  • mysql: encrypting and decrypting data

    - by cbrulak
    Does mysql provide a mechanism for storing and retrieving encrypted data? I don't mean passwords, I mean real strings. I'd like to encrypt a string, store in mysql and then retrieve the decrypted string at a later date. So, I know there is the AES_Encrypt and decrypt functions. But they ask for a key. (which is fine) but I wondering if you call those functions and use your user password as the key. Or something else that is super-simple. Also, is there a simple wrapper for the AES_Encrypt & decrypt functions in Rails? Or do you need to build the query manually?

    Read the article

  • CREATE mysql database with default InnoDB tables?

    - by memilanuk
    Hello, I've been working on writing a SQL statement to create a MySQL database with several default options, including default character set and default collate. Is it possible to add syntax to make the default engine type for tables in this database to be innodb? I've been looking through the MySQL manual for v.5.1 and I've found the statement 'ENGINE=innodb' which would be appended to a CREATE TABLE statement... but I haven't found anything related to a CREATE DATABASE statement. Is there a normal way to do this as part of the database creation, or does it need to be specified on a table-by-table basis? Thanks, Monte

    Read the article

  • Mysql error in php code

    - by Ockonal
    Hello, can't understand mysql error: UPDATE static_pages SET order = " Some new data 222222 "Database error: 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 'order = " $query = 'UPDATE someTable SET '.$key.' = "'.$value.'"'; Here is $key = order; $value = 'new data 222222'; There is such keys in table: order, prices, contacts. Each of these updates well except the 'order'. Why?

    Read the article

  • Using persistent and non-persistent connection together in a PHP MySQL app

    - by cappuccino
    There are parts of my app where a persistent connection is required, in particular the parts where every hour maybe 30,000 select requests are made by many different users, this is causing my mysql server to max out on the 100 connection limit, and i really don't want to increase it since 100 connections already seems like alot. So for the parts of the application where reading and selecting is the case I want to switch to persistent connections. The other parts where data is being modified is usually done through a transaction, and the general rule is never to use persistent connections for transactions according to the php documentation. So I would like to keep this on non-persistent connections. My question is, am i able to use persistent and non-persistent connections together in the same app, the same script etc? I am using PHP 5.2+, MySQL 5+ (InnoDB tables) and the Zend Framework 10.6+

    Read the article

  • Possible apache/mysql/php wrapper?

    - by MrStatic
    I was tasked with writing a smallish program for data input and manipulation. My language of choice happens to be PHP. I have written out the program/site it all works fine is easily portable and everything but have one question. Is there anyway to wrap up apache/mysql/php into a bundle of one exe? I know of MoWes Portable and other options but I am looking to basically wrap everything up into a single exe without much fuss to the end user. My target users are very low on the computer savvy scale. I am trying to avoid a batch file for launching and don't really want them able to shutdown one part on accident and not another (IE shut off mysql but leave apache on).

    Read the article

  • mysql birthday reminder, leap year

    - by moodh
    Hi, I'm trying to sort out a result set that gives the 5 closest users sorted by upcoming birthday. This works perfectly until leap years comes into play. For example: May 15th - 96 days left May 15th - 97 days left The top result is a birth at 1987 and the lower is from 1988. u_birth is stored as yyyy-mm-dd. Is there a simple way to sort this problem without having to rewrite the entire query? SELECT u_birth, IF( DAYOFYEAR( u_birth ) >= DAYOFYEAR( NOW() ), DAYOFYEAR( u_birth ) - DAYOFYEAR( NOW() ), DAYOFYEAR( u_birth ) - DAYOFYEAR( NOW() ) + DAYOFYEAR( CONCAT( YEAR( NOW() ), '-12-31' ) ) ) AS distance FROM (blog_users) WHERE `s_agehide` = 0 ORDER BY distance ASC LIMIT 5 This query is taken and modified from the mysql manual: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#c7489

    Read the article

  • Mysql stored procedures

    - by Richard M
    Hello, I have a unique issue that I need advice on. I've been writing asp.net apps with SQL Server back ends for the past 10 years. During that time, I have also written some PHP apps, but not many. I'm going to be porting some of my asp.net apps to PHP and have run into a bit of an issue. In the Asp.net world, it's generally understood that when accessing any databases, using views or stored procedures is the preferred way of doing so. I've been reading some PHP/MySQL books and I'm beginning to get the impression that utilizing stored procedures in mysql is not advisable. I hesitate in using that word, advisable, but that's just the felling I get. So, the advice I'm looking for is basically, am I right or wrong? Do PHP developers use stored procedures at all? Or, is it something that is shunned? Thanks in advance.

    Read the article

  • Run Sql file in MYSQL PHPMyadmin

    - by Dev
    Hi All, I have written the SQL file with on excecuting it is throwing the error as mysql @"C:\Documents and Settings\Hemant\Desktop\create_tables.sql"; ERROR 1064 (42000): 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 '@"C:\ Documents and Settings\Hemant\Desktop\create_tables.sql"' at line 1 on line 1 code is CREATE DATABASE IF NOT EXISTS test; DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE test; please let me know is i am missing something

    Read the article

  • Why this doesn't work: [MySQL][ODBC 5.1 Driver]Access denied for user

    - by bvandrunen
    So I know that there is a very similar question to this all over the web as well as stack overflow: http://stackoverflow.com/questions/2539961/error-access-denied-for-user-mysql-server but my question I think is different. So I have set up a linked server and it works...I have the correct permissions set up for my IP's that I am using. However the problem arises when our user "webuser@correctIP" tries to access it. Therefore, any user using window authentication is allowed to access it and works great...but any that are not using windows authentication are blocked. However, I have tried all the common solutions such as setting up a strict password, changing security settings in Microsoft SQL Server etc. Nothing is working. Any help is appreciated. Thanks. FYI: I am using this from Microsoft SQL Server 2008 - mysql (through myphpadmin)

    Read the article

  • counting rows that date hasn't yet passed

    - by AdRock
    I am trying to count the number of rows whose date has not yet passed so i can get only the current records I get an error sayng MySQL error #111 Invalid use of group function SELECT COUNT(festivalid) FROM festivals WHERE min(datefrom) > now()

    Read the article

  • Django : mysql : 1045, "Access denied for user

    - by PlanetUnknown
    I have the whole setup working for months on my local computer. I'm installing on a remote site now. Created a fresh mysql DB, and created a new user ("someuser") and gave it complete grants, like so - GRANT ALL PRIVILEGES ON . TO 'someuser'@'localhost' IDENTIFIED BY 'somepassword' WITH GRANT OPTION; I have sync'd the db, using "python manage.py syncdb" and the correct tables were created. My settings.py has this same user. But when I try to login a user through the application, and it hits the DB, I see the following in the logs - (1045, "Access denied for user 'someuser'@'localhost' (using password: YES)") I logged in through mysql (installed on the same box as django) and checked the grants and it correctly shows - Grants for djangouser@localhost GRANT ALL PRIVILEGES ON * . * TO 'someuser'@'localhost' IDENTIFIED BY PASSWORD '*thesaltedpasswordOverHere' WITH GRANT OPTION I don't want to use the root user/password for django, since it doesn't seem the correct way. Any pointers as to what might be wrong ?

    Read the article

< Previous Page | 108 109 110 111 112 113 114 115 116 117 118 119  | Next Page >