Search Results

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

Page 101/1445 | < Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >

  • MySQL don't want to store unicode charecter

    - by Qiao
    Why MySQl don't wont to store unicode character ??? Yes, it is rare hieroglyph, you wouldn't see it in the browser. UTF16 is U+2B5EE Warning: #1366 Incorrect string value: '\xF0\xAB\x97\xAE' for column 'ch' at row 1 Is it possible to store this character in MySQL?

    Read the article

  • Trappings MySQL Warnings on Calls Wrapped in Classes -- Python

    - by chernevik
    I can't get Python's try/else blocks to catch MySQL warnings when the execution statements are wrapped in classes. I have a class that has as a MySQL connection object as an attribute, a MySQL cursor object as another, and a method that run queries through that cursor object. The cursor is itself wrapped in a class. These seem to run queries properly, but the MySQL warnings they generate are not caught as exceptions in a try/else block. Why don't the try/else blocks catch the warnings? How would I revise the classes or method calls to catch the warnings? Also, I've looked through the prominent sources and can't find a discussion that helps me understand this. I'd appreciate any reference that explains this. Please see code below. Apologies for verbosity, I'm newbie. #!/usr/bin/python import MySQLdb import sys import copy sys.path.append('../../config') import credentials as c # local module with dbase connection credentials #============================================================================= # CLASSES #------------------------------------------------------------------------ class dbMySQL_Connection: def __init__(self, db_server, db_user, db_passwd): self.conn = MySQLdb.connect(db_server, db_user, db_passwd) def getCursor(self, dict_flag=True): self.dbMySQL_Cursor = dbMySQL_Cursor(self.conn, dict_flag) return self.dbMySQL_Cursor def runQuery(self, qryStr, dict_flag=True): qry_res = runQueryNoCursor(qryStr=qryStr, \ conn=self, \ dict_flag=dict_flag) return qry_res #------------------------------------------------------------------------ class dbMySQL_Cursor: def __init__(self, conn, dict_flag=True): if dict_flag: dbMySQL_Cursor = conn.cursor(MySQLdb.cursors.DictCursor) else: dbMySQL_Cursor = conn.cursor() self.dbMySQL_Cursor = dbMySQL_Cursor def closeCursor(self): self.dbMySQL_Cursor.close() #============================================================================= # QUERY FUNCTIONS #------------------------------------------------------------------------------ def runQueryNoCursor(qryStr, conn, dict_flag=True): dbMySQL_Cursor = conn.getCursor(dict_flag) qry_res =runQueryFnc(qryStr, dbMySQL_Cursor.dbMySQL_Cursor) dbMySQL_Cursor.closeCursor() return qry_res #------------------------------------------------------------------------------ def runQueryFnc(qryStr, dbMySQL_Cursor): qry_res = {} qry_res['rows'] = dbMySQL_Cursor.execute(qryStr) qry_res['result'] = copy.deepcopy(dbMySQL_Cursor.fetchall()) qry_res['messages'] = copy.deepcopy(dbMySQL_Cursor.messages) qry_res['query_str'] = qryStr return qry_res #============================================================================= # USAGES qry = 'DROP DATABASE IF EXISTS database_of_armaments' dbConn = dbMySQL_Connection(**c.creds) def dbConnRunQuery(): # Does not trap an exception; warning displayed to standard error. try: dbConn.runQuery(qry) except: print "dbConn.runQuery() caught an exception." def dbConnCursorExecute(): # Does not trap an exception; warning displayed to standard error. dbConn.getCursor() # try/except block does catches error without this try: dbConn.dbMySQL_Cursor.dbMySQL_Cursor.execute(qry) except Exception, e: print "dbConn.dbMySQL_Cursor.execute() caught an exception." print repr(e) def funcRunQueryNoCursor(): # Does not trap an exception; no warning displayed try: res = runQueryNoCursor(qry, dbConn) print 'Try worked. %s' % res except Exception, e: print "funcRunQueryNoCursor() caught an exception." print repr(e) #============================================================================= if __name__ == '__main__': print '\n' print 'EXAMPLE -- dbConnRunQuery()' dbConnRunQuery() print '\n' print 'EXAMPLE -- dbConnCursorExecute()' dbConnCursorExecute() print '\n' print 'EXAMPLE -- funcRunQueryNoCursor()' funcRunQueryNoCursor() print '\n'

    Read the article

  • Mysql query trouble: uploading

    - by Jakub Zak
    I'm trying for last hour solve this problem. I have a long form and I'm trying to upload info into mysql database. Into table I made. This is the mysql query I'm using: mysql_query("INSERT INTO `users_temp`(`first_name`, `surname`, `birthday`, `nationality`, `email`, `mobile`, `landline`, `address`, `town`, `post_code`, `country`, `password`, `code_conf`) VALUES ([$f_name],[$s_name],[$bday],[$nationality],[$email],[$mobile],[$landline],[$address],[$town],[$post_code],[$country],[$pass],[$conf_code])"); If anyone see any problem why it doesn't work pls let me know. Thank you...

    Read the article

  • Mysql Removal of primary key

    - by marionmaiden
    Hello, I've removed the primary key of one table of my MySQL database, but now, when I use the MySQL Administrator and try to edit the data of this table, it doesn't allow me to do this. The button edit that appears in the bottom of the table keeps visible, but unable to click.

    Read the article

  • Creating SVG map from geometry stored in MySQL

    - by Barnabe
    I have a group of geometries stored in MySQl (as polygon and as well-known text) representing counties. I can build a table of geometries and color codes after querying some county data (say GDP per capita). What is the best way to export this as an SVG map? I cannot find any reference to SVG conversion in the MySQL documentation.

    Read the article

  • how to store a 2D game world in mysql

    - by monthon1
    I am making a 2D game in javascript/ajax, that will be using data stored in mysql database. Every user have got his own "area" made of small squares that can have some values. But I have no idea, how to store values of each square in mysql, when each user can have area with different width or height. Do you have some idea?

    Read the article

  • When should I use MySQL compressed protocol?

    - by ento
    I've learned that MySQL can compress communication between servers and clients. Compression is used if both client and server support zlib compression, and the client requests compression. (from MySQL Forge Wiki) The most obvious pros and cons are pros: Reduced payload size cons: Increased computation time So, is compressed protocol something I should enable whenever I can afford servers with adequate specs? Are there other factors I should consider?

    Read the article

  • wanna store Object in MySQL database

    - by kandarp
    I have a variable in java which return type is Object(java.lang.Object). I want to store this variable value in MySQL database without casting in any other primitive data type. Is there any data type available in MySQL related to Object? If anybody knows, please reply at your earliest time. Thanks,

    Read the article

  • Development Environment for Testing MySQL Replication

    - by Dave Morris
    Is there an easy way to setup an environment on one machine (or a VM) with MySQL replication? I would like to put together a proof of concept of MySQL replication with one Master write instance and two slave instances for reads. I can see doing it across 2 or 3 VMs running on my computer, but that would really bog down my system. I'd rather have everything running on the same VM. What's the best way to proof out scalability solutions like this in a local dev environment? Thanks for your help, Dave

    Read the article

  • MySQL 5.1 - logging CREATE/ALTER statements

    - by pako
    Is it possible to log CREATE / ALTER statements issued on a MySQL server? I heard that it could be done with a trigger, but I can't seem to find suitable code anywhere. I would like to log these statements to a table, preferably with the timestamp of when they were issued. Can someone provide me with a sample trigger that would enable me to accomplish this? I would like to log these statements so I can easily synchronize the changes with another MySQL server.

    Read the article

  • MySQL: automatic rollback on transaction failure

    - by praksant
    Is there any way to set MySQL to rollback any transaction on first error/warning automatically? Now if everything goes well, it commits, but on failure it leaves transaction open and on another start of transaction it commits incomplete changes from failed transaction. (I'm executing queries from php, but i don't want to check in php for failure, as it would make more calls between mysql server and webserver.) Thank you

    Read the article

  • which is better, creating a materialized view or a new table?

    - by Carson
    I have some demanding mysql queries that are needed to grap same up-to-date datasets from 5-7 mysql tables. I am thinking of creating a table or materialized view to gather all demanding columns from other tables, so as to increase performance. If I create that table, I may need to do extra insert / update / delete operation each time other tables updated. if I create materialized view, I am worrying if the performance can be greatly improved. Because data from other tables are changing very frequently. Most likely, the view may need to be created first everytime before selecting it. Any ideas? e.g. how to cache? other extra measures I can do?

    Read the article

  • PHP - error when insert date into MySQL

    - by Michael Mao
    Hello everyone: I've got a typical problem when trying to insert a date into MySQL. The column defined in MySQL is of type DATE. My PHP version is 5.3.0 Apart from this date-related issue, the rest of my code works just fine. And this is my PHP script to do this: $tablename = BOOKS_TABLE; $insert = mysql_query("INSERT INTO $tablename (barcode, book_name, volume_num,". " author, publisher, item_type, buy_price, buy_date) VALUES ". "(". "'" . $barcode . "', ". "'" . $bookname . "', ". "'" . $volumenum . "', ". "'" . $author . "', ". "'" . $publisher . "', ". "'" . $itemtype . "', ". "'" . $buyprice . "', ". "'" . getMySQLDateString($buydate). //"'STR_TO_DATE('".$buydate ."', '%d/%m/%Y'))'". //nothing changes in MySQL ")"); And this is the faulty function : function getMySQLDateString($buydate) //typical buydate : 04/21/2009 { $mysqlDateString = date('Y-m-d H:i:s', $strtotime($buydate)); return $mysqlDateString; } The first commented out line wouldn't do anything, the script is executed with no error, however, there is nothing changed in datebase after this. The current approach will cause a Fatal error saying function name must be a string in this line. Actually I followed this thread on SO, but just cannot pass the date into MySQL... Can anyone help me figure out which part is not right? How would you do it, in this case, to get it right? Sorry about such a journeyman-like question, thanks a lot in advance.

    Read the article

  • Table prefix for MySqlMembershipProvider

    - by choudeshell
    I have MySqlMembershipProvider working with Asp.Net MVC. My question is how can I configure the table prefix... so instead of 'my_aspnet_' prefix on the tables, I want this to be either none or defined by me. My web.config: <?xml version="1.0"?> <add name="ApplicationServices" connectionString="server=localhost;user id=root;Password=*********;database=sparkSources" providerName="MySql.Data.MySqlClient"/> <authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="2880" /> </authentication> <membership defaultProvider="MySqlMembershipProvider"> <providers> <clear/> <add name="MySqlMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.3.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" autogenerateschema="true" tablePrefix="ss" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="sparkSources" /> </providers> </membership> <profile> <providers> <clear/> <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" /> </providers> </profile> <roleManager enabled="false"> <providers> <clear/> <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" /> <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" /> </providers> </roleManager> <pages> <namespaces> <add namespace="System.Web.Mvc" /> <add namespace="System.Web.Mvc.Ajax" /> <add namespace="System.Web.Mvc.Html" /> <add namespace="System.Web.Routing" /> </namespaces> </pages>

    Read the article

  • Managing User Profiles with PHP/MySQL for Beginners

    - by serhio
    I am beginner in PHP/MySql and would develop a simple site that has user management. I like the idea of using OpenId's (like stackoverflow uses). I wonder from where to start? What should I read? I have not much time so probably will net enter in all details of PHP user session management, this because I search something like User profiles management in PHP for dummies 8D Environment: Linux OS Apache 2.2.15 MySQL 5.1.41 PHP 5.2.13 cPanel 11.25.0

    Read the article

  • Multiple values one field mysql

    - by chloe
    Basically I have a a mysql database which i want to create containing the following tables: artist song album A song can belong to only one artist, however, a song could be in Multiple Albums. How would I go about implementing this in my mysql database. I've been stuck for a few days now :(

    Read the article

  • supported MySQL for Python2.6.1

    - by SKSK
    Can any one tell me which MySQL version is suitable for Python2.6.1 to connect MySQLdb, I am using MySQL4.0.23 and MySQLdb of MySQL-python-1.2.3c1.win32-py2.6 after successfully installation also its showing No module named MySQLdb and I sent the Environment Variables also properly for Python2.6, using Windows XP, tested import MySQLdb through command prompt its not showing any errors then what could be the problem, I am straggling on this since last 2days, Please tell what could be the problem

    Read the article

  • How to make xml file from php and mysql

    - by Mirage
    My fellow friend is building site in flash and he uses xml files to access data in Flash. I want to build editable cms so that client can edit stuff. Now i don't' have any experience with XML. I know php html mysql very well. SO how can i change those already build xml files using mysql and php. ANy help??

    Read the article

  • Using Time datatype in MySQL without seconds

    - by Alex
    I'm trying to store a 12/24hr (ie; 00:00) clock time in a MySQL database. At the moment I am using the time datatype. This works ok but it insists on adding the seconds to the column. So you enter 09:20 and it is stored as 09:20:00. Is there any way I can limit it in MySQL to just 00:00?

    Read the article

< Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >