Query Does Not Work On Some Server Instances
query:
Select * From Students Where C_Name = "XXXXXX"
WHen I run this query on 2 of my computers, the result returns no rows.
When I run this query on a remote machine hosted by 1and1, with a copy of the same database, the query returns the correct row.
The syntax is identical.....
View Complete Forum Thread with Replies
Related Forum Messages:
SELECT `*` Not Work On New Server
I wrote some code a long time ago that used SELECT `*` from blah blah blah. I'm building a new server with a new installation on MySQL 4 and for some reason this piece of code wasn't working. I looked into it, and turns out only SELECT * not SELECT `*` works on this new server. Now I realise this is probably my crappy coding, but is there some variable I can turn on/that is different between the servers that makes this happen? I've used this code on loads of servers and never had a problem, and would rather not go through all my code fixing this error
View Replies !
Mysql Server Wont Work
i am having mysql install with Plesk 7.5 for windows and yasterday the mysql server wont work everytime i click to start it stop in same sec how can i solve the problem and did that will make m elost my db ?
View Replies !
What Query Would Work For This?
I have two tables: say Yes and No. Yes(ID, YesEmail, EmailOwner); No(ID, NoEmail); Both YesEmail and NoEmail contain email addresses. What query can retrieve all the email addresses in Yes table that are not listed in No table? Thanks in advance.
View Replies !
Cannot Get MySQL Query To Work In .asp
I have a MySQL database and in the front-end software I am using to Run MySQL, I have created a query on the tables which runs in the front-end, similar to the MS Access query grid. I now wish to pull this query on-line using .asp, but I seem to have found out that I can only pull data from tables in MySQL? ....
View Replies !
Query Wont Work
PHP Code: if(mysql_query("UPDATE users SET referer_score=referer_score+1 WHERE userID='$frommysql_referer'")) { die(mysql_affected_rows()); im trying to figure out why refer_score isnt being iincremented as im expecting it to. i know that the value of $frommysql_referer is the right value that im expecting it to be. just it wont increment referer_score. and mysql_affected_rows() wont print anythnig to the screen
View Replies !
Query Doesn't Work With Mysql4
Can someone tell me what's wrong with the mysql query below? It does work on mysql 5 but gives me an error with mysql 4. SELECT rev_profile_indiv. * FROM rev_profile_indiv, rev_profile_kids_indiv WHERE 1 AND reviewing IN ( 1, 0 ) AND active IN ( 1 ) AND contract IN ( 1 ) AND UNIX_TIMESTAMP( DATE( rev_profile_kids_indiv.birthdate ) ) >= UNIX_TIMESTAMP( ��-12-15' ) AND UNIX_TIMESTAMP( DATE( rev_profile_kids_indiv.birthdate ) ) <= UNIX_TIMESTAMP( ��-12-15' ) GROUP BY rev_profile_indiv.username ORDER BY lastname LIMIT 0 , 30;
View Replies !
What Do I Need To Do To Make This Query Work?
I must've been working too long hours this week, as my flow of ideas has come to a complete stop. Its really quite simple: 2 tables - bookings , invoices These two counts gives me precisely what I want PHP $unpaid_bookings = mysql_result(mysql_query("SELECT COUNT(id) FROM bookings WHERE invoice_id = 0 AND client_id = $id AND status != Ɔ' AND finish <= '$time'"),0);$total_bookings = mysql_result(mysql_query("SELECT COUNT(id) FROM bookings WHERE client_id = $id AND status != Ɔ' AND finish <= '$time'"),0); so I present this in a ratio, $unpaid_bookings / $total_bookings... awesome now, when I try and flip the coin and show unpaid invoices over total invoices, it all falls apart once I have more than 1 booking per invoice. First i'll explain the table structure. Each booking has a column `invoice_id`, which is assigned to the primary `id` of the invoice table. So one invoice might be associated with x bookings. PHP $unpaid_invoices = @mysql_result(mysql_query("SELECT COUNT(i.id) FROM invoices i, bookings b WHERE i.id = b.invoice_id AND b.client_id = $id AND i.is_paid = Ɔ'"),0);$total_invoices = @mysql_result(mysql_query("SELECT COUNT(i.id) FROM invoices i, bookings b WHERE i.id = b.invoice_id AND b.client_id = $id"),0); Again so it works fine when 1 invoice is associated to 1 booking, but when 1 invoice is associated with say 2 bookings, the invoice count will return two instead of one. The worst part is, I know exactly why (because there are two bookings for the invoice), I just can't get around it! I've tried all sorts of joins, group by's, and i'm not having any luck. I'm trying not to be weak and add the client_id into the invoice table,
View Replies !
Cant Work Out Correct Select Query For ..
mysql> select * from parent_cat; +-------+----------+----------+ | catid | pname | psection | +-------+----------+----------+ | 1 | Trainers | Men | | 2 | Bags | Woman | | 4 | Boots | Woman | | 5 | Fragance | Men | +-------+----------+----------+ 4 rows in set (0.00 sec) mysql> select * from categories;; +-------+---------------------------+---------+------+ | catid | catname | section | pid | +-------+---------------------------+---------+------+ | 1 | Nile | Men | 1 | | 2 | Bags | Woman | 2 | | 4 | Boots | Woman | 4 | | 6 | Air Force I & II Trainers | Men | 1 | | 7 | Adidas Trainers | Men | 1 | | 8 | Timberland Trainers | Men | 1 | | 9 | Lacoste Trainers | Men | 1 | | 10 | Gucci & Hogen Trainers | Men | 1 | | 11 | D&G Trainers | Men | 1 | | 12 | Prada Trainers | Men | 1 | | 13 | Chanel Trainers | Men | 1 | +-------+---------------------------+---------+------+ and the following query: $pid = $_GET['catid']; $query = "SELECT categories.catid, categories.catname, categories.pid FROM categories, parent_cat WHERE categories.section = 'Men' AND parent_cat.catid=categories.pid AND categories.pid = '$pid'"; At the moment the query only returns all categories.catname when my categories.catid = 1, but returns nothing if it equals something else?
View Replies !
Degrading Sub Select Query To Work In MySQL 4
I have the following query working as intended in MySQL 5. However, I had not realised that the target server is running 4.0.2 and it's not possible to upgrade. SELECT records.player_id, records.record_id, records.game_id, records.updated, game_modes.mode_title, records.record_time, players.firstname, players.lastname, players.nickname, players.country, teams.team_title, classes.class_title, tracks.track_title, games.game_title, games.version, record_types.type_title FROM games, records, classes, teams, tracks, record_types, players, game_modes WHERE records.record_time = ( SELECT MIN(record_time) FROM records WHERE records.player_id = players.player_id AND records.game_id = 1 AND records.mode_id = 1 AND records.track_id = 1 AND records.class_id = 5 AND records.type_id = 1 GROUP BY records.player_id) AND records.track_id=tracks.track_id AND record...................
View Replies !
Query Which Gets Rows Based On A Radius, Lon And Lat Doesn't Work?
I have found this query which gets rows based on a radius. I need this for zip codes based on lon and lat's. $sql2 = "SELECT * FROM table as z WHERE (SQRT( (69.1 * (".$userLat." - z.lat)) * (69.1 * (".$userLat." - z.lat)) + (53.0 *(".$userLong." - z.lon)) * (53.0 *(".$userLong." - z.lon))) <= ".$userRadius." )"; return $sql2; $res = mysql_query($sql2, $connDB) or die(mysql_error()); $row = mysql_fetch_assoc($res); based on a test zip code gives a result like SELECT * FROM table as z WHERE (SQRT( (69.1 * (52.399834 - z.lat)) * (69.1 * (52.399834 - z.lat)) + (53.0 *(4.840762 - z.lon)) * (53.0 *(4.840762 - z.lon))) <= 100 ) the lat and lon of the test zip code are right. As you can see z.lat and z.lon don't get any value. And these would be every lat and lon in table. In my db table lon and lat are decimal(10,6) type with a default value of 0.000000
View Replies !
Reformatting Email Address To Work On SELECT Query
This is probably basic, but so far I cant find any articles about this. I want to "SELECT * FROM dbase WHERE emailaddress = $email;" $email is a feed from PHP, and will contain a string like "some.one@someplace.com" Apparently with $email as a normal string, it gives an error saying: "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 '@someplace.com)' at line 1" I reckon it's the dots and the @s that terminate the syntax and making it not work. How can i get out of this problem? Is there any function I can call to solve this? Or probably a little bit of more programming?
View Replies !
Lost Connection To MySQL Server During Query (LAMP Server)
I recently installed an ubuntu LAMP server for my website and upon trying a script that uses a mysql database (which I set up the tables via phpmyadmin) and I get this error: Warning: mysql_connect(): Lost connection to MySQL server during query in /home/tanner/Desktop/bot/DoctorWho/db_connect.php on line 4 I've searched the forums and I've gotten no answers. Anyone know the answer?
View Replies !
Lost Connection To MySQL Server During Query / Server Has Gone Away
All of a sudden the server stopped working. When trying to execute a simple INSERT both from PHP and Query Browser, the server crashes and I get either "Lost connection to MySQL server during query" or "Server has gone away" errors. The problem started on 5.0.18, and upgrading to 5.0.41 didn't help. I'm using Windows XP SP2. I've seen quite a few posts on similar problems, but no real solutions though. Is that a bug?
View Replies !
Instances Automatically
I have 2 mysql servers happily running on the same box. The default server being on 3306 and socket mysql.sock. With a second server running on 3307 with socket mysql1.sock. I can start and stop these fine from the command line. However I can not figure out how to get both to run autmotically on machine start up / restart etc. The default mysql server starts up fine due to the mysql.server script. I have looked into mysqld_multi, which again i can use fine from the command line as a tool to get both running. However I can not work out how to integrate this or any other technique into the actual startup process.
View Replies !
Setting All Instances Of A Value To Zero?
I am writing a basic CMS for a project and i need to be able to set every instance of a value to zero in a mysql database. eg. there are 20 entries, each with the value '1' in the 'default' column. I want to change all of their 'default' values to 0 in one query. How can i do this?
View Replies !
Multiple Instances In Another Table
I have 2 tables, and want to compare a field in the first table to multiple in the other I'll try to write it not in pseudo code, to try and explain what I would like to do table1-structure field_need_this | field1 | field2 | ... table2-structure field3 | field4 | field5| ... SELECT field_need_this FROM table1 WHERE field1 NOT EQUAL TO (SELECT field4 FROM table2 WHERE value 'something')*this could for example be 4 values. If field1 isn't the same as any of them I would like the field_need_this
View Replies !
Anyway To Run 2 Instances Of MySQL On The Same Machine?
I was wondering if there is anyway I can run 2 instances of MySQL Server on the same machine, the reason is I have one machine and I want to be able to simulate my program which really talks between 2 systems accessing their own MySQL server datas but I dont have 2 machines with me all the time to do this, it would be great If I could somehow manage this.
View Replies !
Counting Instances In An Array
I have no experience of designing, databases or using script or code but I now find I have to work with an existing database. I have a field in a table called outstanding objectives. It contains data such as Y,12,Y,Y,1,3,Y (Its is an array writen as text to the field by Flash) another field in the same row indicates the number of items in this array, in this case the entry would say 7. Id like to know how to count the number of Y's in the array, then express this number as a percentage of the value in the second field e.g. 4/7 and then write the percentage value into a new field.
View Replies !
One Value, Unknown Number Of Instances
Say I want to have a DB that keeps track of how many pints (of prune juice) I drink (okay, bad example) Each pint will have a size and the amount of time it took to drink, but I don't know how many pints I will have in each instance. Would I have a table for Pint that had pint_size and drink_time, and then a table DrinkingSession that had num_of_pints? But then how would I log the time for each pint? Could I write a DrinkingSession table that had pint1, pint2 pint3, etc?
View Replies !
Select Most Common Instances
request a list of the top X most common entries in a particular field and order from most common to least common ? so if the values were: b,d,a,b,c,b,c,d,a,c,e,d,d,b,d it would return d,b,c,a,e..
View Replies !
Copying Tables Between Instances
copy entire databases between two pcs (1 has MySQL 6 the other MySQL 5) just fine using... mysqldump -u username_a -ppassword_a --all-databases | mysql -u username_b -ppassword_b -h host username_a - Should be the username for the server you are backing up password_a - Should be the password for the server you are backing up username_b - Should be the username for the new server password_b - Should be the password for the new server host - Should be the hostname or ip address of the new server However I just want to copy 1 table in 1 database. The help file shows: There are three general ways to invoke mysqldump: shell> mysqldump [options] db_name [tables] shell> mysqldump [options] --databases db_name1 [db_name2 db_name3...] shell> mysqldump [options] --all-databases If you do not name any tables following db_name or if you use the --databases or --all-databases option, entire databases are dumped. I've tried various versions of #1 ( themysqldump [options] db_name [tables]) but can't get it to work. I've also tried the --tables --tables Override the --databases or -B option. mysqldump regards all name arguments following the option as table names. But couldn't get it to work either.
View Replies !
Manage MySQL Instances
I am using the version 4.1.12a Windows XP In one customer I found the same version as mine and the ini file has [mysqld] port=3306 server-id = 1 basedir="C:/MySQL/" datadir="C:/MySQL/Data/" and the service is mysqld-nt the question I want to have the same service (mysqld-nt) But different directory of my data datadir="C:/MyData/Data/" How can I do it in the configuration file??
View Replies !
Update All Instances Of A Field To Default Value
Is there a statement or way in MySQL to update a several fields in a database to the default value? Basically reseting the value with out deleting it. I can go through an manually do that by looking at the number and manually setting it to that but it would be easier to just say: Update table set field=default That didn't work but that's what I'm trying to do. While at it is there any easy way to do it with PHPMYADMIN which is what I manage my DB's with.
View Replies !
Do I Have Multiple Instances Of Mysql Installed?
I'm running ubuntu 6.06, with a web application called Joomla. Right now our databases appear empty.. while i originally panicked, our web application is running smoothly. I cant figure out why this app would work while it needs mysql. Is it possible this is connecting to another instance of mysql on my server and how would i tell?
View Replies !
Multiple Instances: Moving Database?
I have two mysql instances on the same box. I would like to move one database to the 2nd instance. Does anyone know of an easy way to accomplish this, preferably without going through the dump/import process?
View Replies !
Mysql Starts Multiple Php-instances
i have a little problem with a server, running mysql and php. I don't know which php-version i am working with, but the following is the answer for 'mysql --version' mysql Ver 11.18 Distrib 3.23.52, for suse-linux (i686) I know, that this version is not the newest one, but thats not my business. My problem is that i need to execute a script, which starts mysql with this command: mysql -hlocalhost -uuser -ppass db < $update > $update_log whenever this command is running and the 800k $update file is working on the db (a lot of delete and insert statements) there are several php-instances created. So many that they are slowing-down the server, that he is unusable.
View Replies !
Using Linux Symlinks W/Multiple MySQL Instances
We run multiple instances of MySQL on Linux. Each instance has its own directory structure. Along with other databases, each customer has a 5GB non-updating database that is used only for reference. Currently we have multiple copies of this database, which takes up a lot of disk storage. Since this particular database does not get updated, is it okay to have a single copy of it in a commonly accessible location and give the separate instances of MySQL access to it through symbolic links?
View Replies !
Multiple Instances :: Pointing To The Same Data Files/the Same Database?
I think I know the answer to this question, but is it possible and safe to have multiple instances of MySQL pointing to the same data files/the same database? I'm guessing that because only one instance can lock the files at any time that this won't work, but some confirmation would be good. I checked the MySQL documentation, but didn't see anything.
View Replies !
Linux RHE5 Startup Script For Multiple MySQL Instances
I have 2 instances of mysql 5.0.67 installed on one server. They are under 2 separate linux accounts (mysql & mysqldev). Each is installed in a non-standard location: mysql: /opt/mysql/5.0 mysqldev: /opt2/mysql/5.0 Each uses its own data directory: mysql: /ua01/mysqldata mysqldev: /ua03/mysqldata I have ONE /etc/my.cnf file owned & grouped as mysql. The my.cnf file contains the following (commented lines at beginning and end of the file are omitted): [mysqld_multi] mysqld = /opt/mysql/5.0/bin/mysqld_safe mysqladmin = /opt/mysql/5.0/bin/mysqladmin # Here follows entries for some specific programs # The MySQL server for STAGING [mysqld1] mysqld = /opt/mysql/5.0/bin/mysqld_safe mysqladmin = /opt/mysql/5.0/bin/mysqladmin port = 3306 socket = /tmp/mysql.sock skip-locking key_buffer = 16M max_allowed_packet = 1M table_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M # TNC specifics basedir=/opt/mysql/5.0 ledir=/opt/mysql/5.0/bin datadir=/ua01/mysqldata log=/opt/mysql/admin/log/cricket.log log-error=/opt/mysql/admin/log/cricket.err pid-file=/opt/mysql/admin/log/cricket.pid log-bin=/dbarchive/mysql/cricket-bin.log....
View Replies !
Query For Server Name
I am running a mysql cluster with several API nodes. I just setup load balancing and getting ready to do some tests. I want to run a query for something like servername on a loop and see if my load balancer is sending every other query to different API nodes. Is there a select statement I can use to find out the server name?
View Replies !
Convert Sql Server Query
I am trying to convert an old sql server query into a mysql query.This is the current query: select filename, folder2, folder1 from history as T1 where T1.time_str like '01/Jan/07*' and T1.billed = 'no' and T1.username like 'zummy12' and T1.time_str = (Select Top 1 T2.time_str From history T2 Where T1.folder2 = T2.folder2 and T1.username = T2.username And Left(T1.time_str,12) like Left(T2.time_str,12) Order By T2.[date_time] Desc) which produces the following error: (1064, "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 'Select Top 1 T2.time_str From history T2 Where T1.folder2 = T2.")
View Replies !
Mysql Query Between Two Server
I have two Mysql server and I have to execute a query like this: insert into thisserver.table1 select * from anotherserver.table1 where anotherserver.table1.columnid not in (select * from thisserver.table1) Is it possible (like in MS Sql)?
View Replies !
Server Slow When Exec Following Query
i try to tweak mysql server but the process still very slow to exec o following query exec time 2min for 11k row in two table update uploaded,uploaded_job set uploaded.export = 'yes' WHERE uploaded.work_order =uploaded_job.work_order and uploaded_job.claim_status IS NULL i had try indexing and optimise my database result still the same.
View Replies !
Switch Query Logging While The Server Is Running
It would be nice if general query logging could be switched on and off while the MySQL server is running, and not only at startup time. While debugging an application that uses foreign database access libraries, this would be very helpful. One could switch on logging, perform an activity, switch off logging, and look what has happened. Otherwise, the server has to be restarted to change logging, which is a bit annoying...
View Replies !
Lost Connection To MySQL Server During Query (install)
Bog standard SuSE 8.2 Linux install. I have installed mySQL (off the SuSE 8.2 distro CDs). I can connect locally, e.g: bealzebub> mysql -u root -p mysql -h localhost ....logs me in just fine. However, this: bealzebub> mysql -u root -p mysql -h bealzebub ....causes the connection to fail with: "ERROR 2013: Lost connection to MySQL server during query". Its the same if I try to log in from another machine.
View Replies !
Lost Connection To Mysql Server During Query (Windows XP)
I have following problem: when I try to connect from Windows XP to mysql server (linux computer), I get the following error: Lost connection to mysql server during query. This happens when I test the connection. I have firewall in linux, so I opened the port 3306. Is there something else I need to change to make sure that the connection will work properly?
View Replies !
Lost Connection To Mysql Server During Query (VB Front End)
I'm running mysql stored procedure using VB as front end. While clicking Ok button in application it calls 3 stored procedures and returns a resultset. First time it works properly. If second time clicked the error 'lost connection to mysql server during query' displayed. Third time works fine. Like this alternatively throws error message.
View Replies !
|