Search Results

Search found 18661 results on 747 pages for 'linq to mysql'.

Page 166/747 | < Previous Page | 162 163 164 165 166 167 168 169 170 171 172 173  | Next Page >

  • Error when creating database in MySQL using Netbeans 6.8

    - by nix
    I am trying to create a database using MySQL statements in NetBeans 6.8. However, I keep getting Error code 1064. I don't know what the problem is really since the same statements work in NetBeans 6.0. Here is the error: Error code 1064, SQL state 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 '; /*!40000 ALTER TABLE students ENABLE KEYS */; -- -- Definition of table `w' at line 1016 Line 46, column 1

    Read the article

  • MySQL SELECT where if stores have X, show me everything that they have

    - by tnt0932
    I have a MYSQL table like this: STORES (SPID, StoreID, ProductID); And data like this: { 1 | s1 | p2 } { 2 | s1 | p7 } { 3 | s1 | p8 } { 4 | s2 | p1 } { 5 | s2 | p3 } { 6 | s2 | p6 } { 7 | s2 | p9 } { 8 | s3 | p2 } { 9 | s3 | p5 } And I would like to: Use a MYSQL SELECT query to get results, where if a store has a certain product, then a list of all of the products at that store will be returned. For example, if I were looking for "p2", then I would like to know that "s1" has "p2, p7, p8" and "s3" has "p2, p5". Please let me know if you require any more information. I'm not sure what is required to solve this issue (Which is probably why I can't search and find the answer!) Thank you.

    Read the article

  • Search for string within text column in MySQL

    - by user94154
    I have mysql table that has a column that stores xml as a string. I need to find all tuples where the xml column contains a given string of 6 characters. Nothing else matters--all I need to know is if this 6 character string is there or not. So it probably doesn't matter that the text is formatted as xml. Question: how can I search within mysql? ie SELECT * FROM items WHERE items.xml [contains the text '123456'] Is there a way I can use the LIKE operator to do this? Thanks

    Read the article

  • jQuery Load MySQL Fetch Array

    - by Robert Hanson
    I'm a beginner in jQuery area and I have simple question like this : I want to load (AJAX) MySQL result in array, let's say : $row[0] = first name $row[1] = last name $row[2] = phone number I have no problem with PHP part, but I have difficulties to display each of that array content on different id. because syntax I found loads everything processed by PHP : <script type="text/javascript"> $(document).ready(function(){ $('#mysql-result').load('ajax.php'); }); </script> how to get 'First Name', 'Last Name' and 'Phone Number' from PHP with only one time load and still I can put the result in different . thank you.

    Read the article

  • password limitations in SQL Server and MySql

    - by asteroid
    Does MySql 5.1 and SQL Server 2008 (Web edition, Standard) have any functional password limitations other than length limits? Are metacharacters in any form a bad idea to use, like bang, pipe, hash, any slash, carrot, and so on? I know that MySql 5.1 has a password length limitation of 16 characters that is hardcoded, but I was wondering, are any metacharacters (i.e. non alphanumerics) a bad idea to use? And is this true in SQL Server 2008 Web edition, Standard? So specifically: can symbols like: /`~:}{[]^ be used successfully? I would hope it doesn't matter to the database, but I don't understand enough about password storage in enterprise database systems yet to know for sure, and I was looking for confirmation or an explanation.

    Read the article

  • Help - since adding an elastic load balancer to my EC2 web application I cannot connect with the MySQL database (not in AWS)

    - by undefined
    I have a web application that uses an EC2 instance to receive uploaded images, resize and store on S3 and update my MySQL database with the image record. This database is hosted outside Amazon Web Services and so obviously involves communication between the EC2 instance and the database. Images are posted to the upload server from a Flash client which receives the IP address of the upload server when it is loaded and so sends images to 1.12.23.34/resize_script.php This has worked great .. until i started to try and include a load balancer. Since the ELBs do not use an IP address but a DNS address I am now passing this to Flash. Now when I upload images I get the following response from the server - Could not connect to MySQL: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 What might be causing the lost connection to MySQL server. Is there any additional steps I need to take to allow my upload servers to be load balanced? I have set the host property of my MySQL privileges for this user to % any pointers greatly appreciated thanks.

    Read the article

  • MySQL comparisons between multiple rows

    - by Hurpe
    I have a MySQL table with the following columns: id(int), date (timestamp), starttime(varchar), endtime(varchar), ... I need to find time slots that are occupied by two or more rows. Here is an example table id| date |starttime|endtime | __|_____________________|_________|________| 1 | 2010-02-16 17:37:36 |14:35:00 |17:37:00| 2 | 2010-02-17 12:24:22 |12:13:00 |14:32:00| 3 | 2010-02-16 12:24:22 |15:00:00 |18:00:00| Rows 1 and 3 collide, and need to be corrected by the user. I need a query to identify such colliding rows - something that would give me the ID of all rows in the collision. When inserting data in the database I find collisions with this query: SELECT ID FROM LEDGER WHERE DATE(DATE) = DATE('$timestamp') AND ( STR_TO_DATE('$starttime','%H:%i:%s') BETWEEN STR_TO_DATE(STARTTIME,'%H:%i:%s') AND STR_TO_DATE(ENDTIME,'%H:%i:%s') OR STR_TO_DATE('$endtime','%H:%i:%s') BETWEEN STR_TO_DATE(STARTTIME,'%H:%i:%s') AND STR_TO_DATE(ENDTIME,'%H:%i:%s') ) AND FNAME = '$fname'"; Is there any way to accomplish this strictly using MySQL or do I have to use PHP to find the collisions?

    Read the article

  • Automatic Backup and Restore MySQL db from Web Server to Local Machine

    - by Rhepungus
    I have a web app that is supposed to be run on a single local machine (kiosk display), but I want the option to let a user make changes on the web (from any PC) and update the instance on their local PC (kiosk display). From what i imagine, the MySQL instance on the web will just be replace the MySQL instance on the local (kiosk display) machine. Does anyone know of a way to do this? I am open to a product or coding it myself... I will appreciate any info or brainstorm. Thanks.

    Read the article

  • Mysql Replication out of sync? What commands do I run to sync it back up?

    - by Alex
    I have a master-master replication system. However, due to an auto-increment issue, I got an error in replication...and it stopped replicating. Someone told me to do: stop slave; SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; start slave; It didn't work. Then they told me to do: SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 2; It didn't work. Then to test it out, I did: SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 99999; It starts, but it is not updating. I created a table on DB1...and it is not showing up on DB2... Below are the SHOW STATUS for both my DB1 and DB2 (I hit them together): mysql> show master status\G *************************** 1. row *************************** File: mysql-bin.000605 Position: 2019727 Binlog_Do_DB: Binlog_Ignore_DB: 1 row in set (0.00 sec) mysql> show slave status\G; *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: Master_User: Master_Port: Connect_Retry: 60 Master_Log_File: mysql-bin.000605 Read_Master_Log_Pos: 2008810 Relay_Log_File: mysqld-relay-bin.001731 Relay_Log_Pos: 10176595 Relay_Master_Log_File: mysql-bin.000470 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 4255373725 Exec_Master_Log_Pos: 10176458 Relay_Log_Space: 135062517347 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 1376343 1 row in set (0.00 sec) How do I fix it so that they sync back up again? Thank you.

    Read the article

  • MySQL TEXT field performance

    - by Jonathon
    I have several TEXT and/or MEDIUMTEXT fields in each of our 1000 MySQL tables. I now know that TEXT fields are written to disk rather than in memory when queried. Is that also true even if that field is not called in the query? For example, if I have a table (tbExam) with 2 fields (id int(11) and comment text) and I run SELECT id FROM tbExam, does MySQL still have to write that to disk before returning results or will it run that query in memory? I am trying to figure out if I need to reconfigure our actual db tables to switch to varchar(xxxx) or keep the text fields and reconfigure the queries.

    Read the article

  • Beginners PHP / mySQL question

    - by Reg H
    I'm brand new to PHP & MySQL, and one function I'm creating needs to access a large table or database. I've created the database and it's currently in a MySQL table, which I'm accessing with no problem. The table is 11,000 rows in length, with 8 columns (all text less than 8 characters long) - it's static, and will never change. Without getting too particular, my users will hit a button which will trigger scripts to access the data, say 500 times or more. So in general would it be better practice to include all of this data in a big 'switch' or 'if... then' conditional right in my scripts, rather than opening and accessing the database connection hundreds, or maybe even thousands of times? It just seems like that might be a bottleneck waiting to happen. Thanks!

    Read the article

  • Problems with mysql syntax

    - by user368453
    Hello everyone !! I´m trying to create a trigger on MySQL but I´m having a sintaxe problem, which I was not able to find. If someone more experient could help me it would be great (it´s the first time I use MySQL!)... The reason why I´m creating this trigger is for deleting all the orphan "labels", which has a many-to-many relation with "service_descriptor" (this two entities are linked by service_labels). The code I have is: CREATE TRIGGER trg_delete_orphan_label AFTER DELETE FOR EACH ROW ON restdb.service_labels DELETE FROM restdb.labels WHERE EXISTS (SELECT * FROM old D LEFT_JOIN restdb.service_labels SL ON SL.id_label = D.id_label AND D.id_service = SL.id_service WHERE SL.id_label IS NULL restdb.labels.id = D.SL.id_label ); Thanks in advance !

    Read the article

  • Updating cached counts in MySQL

    - by phleet
    In order to fix a bug, I have to iterate over all the rows in a table, updating a cached count of children to what its real value should be. The structure of the things in the table form a tree. In rails, the following does what I want: Thing.all.each do |th| Thing.connection.update( " UPDATE #{Thing.quoted_table_name} SET children_count = #{th.children.count} WHERE id = #{th.id} " ) end Is there any way of doing this in a single MySQL query? Alternatively, is there any way of doing this in multiple queries, but in pure MySQL? I want something like UPDATE table_name SET children_count = ( SELECT COUNT(*) FROM table_name AS tbl WHERE tbl.parent_id = table_name.id ) except the above doesn't work (I understand why it doesn't).

    Read the article

  • MySQL text field issues

    - by chenger
    This is quite a noobish question, I have searched for a few hours now and I know this has to be simple. I am using XAMPP and I am trying to learn some more about using PHP and mySQL together. When I create the DB and the table for information to store, I tried insert info to the table and it stores it as a .dat file rather than text. I know this has to be with how I am setting up the table or the DB but I have gone through things and I think I am just skipping over something. * Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0 * MySQL client version: 5.1.37 * PHP extension: mysqli that is the phpmyadmin info.

    Read the article

  • Getting deadlocks in MySQL

    - by at
    We're very frustratingly getting deadlocks in MySQL. It isn't because of exceeding a lock timeout as the deadlocks happen instantly when they do happen. Here's the SQL code that is executing on 2 separate threads (with 2 separate connections from the connection pool) that produces a deadlock: UPDATE Sequences SET Counter = LAST_INSERT_ID(Counter + 1) WHERE Sequence IS NULL Sequences table has 2 columns: Sequence and Counter The LAST_INSERT_ID allows us to retrieve this updated counter value as per MySQL's recommendation. That works perfect for us, but we get these deadlocks! Why are we getting them and how can we avoid them?? Thanks so much for any help with this.

    Read the article

  • mysql_close(): supplied argument is not a valid MySQL-Link resource

    - by maxedison
    I'm trying to get the hang of using custom session handlers to store session data in a MySQL database. However, I keep getting the following warning: mysql_close(): supplied argument is not a valid MySQL-Link resource Here's the code I'm using, which I got from here: function _open(){ global $_sess_db; $_sess_db = mysql_connect("localhost", "root", "******"); if ($_sess_db) { return mysql_select_db('style', $_sess_db); } return false; } function _close(){ global $_sess_db; return mysql_close($_sess_db); //error happens here } The full text of the error message ultimately points to the final "return mysql_close($_sess_db);" line. I can confirm that the mysql_connect info does in fact work, and I do have the rest of the session handler functions defined as well. And in case it helps, I get these errors immediately upon page load, without actually calling any of the session handler functions, and without having any current sessions open.

    Read the article

  • mysql querying age from dob

    - by Confused
    My MySQL database has date of birth stored in the format yyyy-mm-dd, how do I query the database - without using php code - to show me results of people born within x years of now, and/or, who are y years of age? The table is called users, the colum is called dob. I've spent a while viewing the MySQL manual but I can't work out precisely how to form my query. So far I went for select * from users where dob... but I don't think that's the way to go.

    Read the article

< Previous Page | 162 163 164 165 166 167 168 169 170 171 172 173  | Next Page >