mysql

i have query not working for order by (SELECT * FROM products WHERE ParentID=139 AND `Position`!=0 AND ( (69.1 * (lattitude- 53.84787)) * (69.1 * (lattitude- 53.84787)) ) + ( (69.1 * (longitude- (-1.77684)) * COS(53.84787 / 57.3)) * (69.1 * (longitude- (-1.77684)) * COS(53.84787 / 57.3)) ) < POW(5, 2) ORDER BY `Position` ASC) UNION (SELECT * FROM products WHERE ParentID=139 AND `Position`=0 AND
I have records in the mysql database. in the browser, I need to display just the id or the name and it should be clickable, when clicked it should show the other info like email, phone etc.. I can list the names using SELECT but not sure how to link it and show the data..if there is a jquery method to display the data in a div, it would be good ..please advise me how to start with..thanks. ex <a href="">rob</a> <a href="">mike</a> <a
I am connecting to a mysql database online from my local C# .NET Winform application. I want that till the application connects to the online database, a Progress Bar is displayed , and as soon as the database connection is established, the progress bar should also complete incrementing. please help with code. how do i get the time taken by the application to connect to the online database , and then set that time as INTERVAL for the progress bar? Why don't you change
I am attempting to remotely connect to a MySQL database using ruby on rails. In my database.yml: development: adapter: mysql database: peer host: host port: 3306 username: root password: password I then go to do a rake db:migrate and get this error Mysql::Error: The 'InnoDB' feature is disabled; you need MySQL built with 'InnoDB' to have it working: CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB Now after some searching, I found that this
I've tried to install mysql on OSX many a time and failed every time - I've tried installing it with macports, brew and somethign else, I can't remember. I ended up having someone who knows what they're doing getting it to work. After it was installed, Rails happily obliged in creating databases for me. However, at this point, I need to run some arbitrary queries and upon running 'mysql' command in the terminal I see that the databases available through there are absolutely not what
I recently started experimenting with CakePHP. I used this query in "normal" PHP and need to convert it to a CakePHP find. However I can't seem to make it work! SELECT *, (SELECT name FROM `users` WHERE `users`.`id`=`products`.`creator`) AS creatorname FROM `products` WHERE `products`.`ID`='2' It's a basic set up with 2 tables, users and products. Every product gets created by a user and I need to load the name of the user along with the product info. (So I can display the
I am taking over a project from an existing programmer who, to be honest, left the project in a massive heap of unmaintainable, unreadable mess (edit/clarification: dozens upon dozens of standalone .php pages that are a soup of php/html/css that all reference one giant 1500 line 'functions.php' file, ack) That being said, it seems that pretty much everywhere there is a variable, array, etc. he used printf(). For example, instead of using: foreach($thing as $t) { echo
in table I have a several columns which are related to address ( street, city, zip code etc.) How define 'constant alias' in table when set a query like select adress from table ; ? which will replace by query: select concat( zip_code, ' ', city, '; ', street ) adress from table I would like to prevent using concat statement in each query. It sounds like you want a computed column, but this is not supported in MySQL. Instead you can create a view that includes all the
I am planning on creating a web interface, in which users will create fields to store information from robot matches. Each year the competition is different, and thus the information that needs to be recorded is different. Usually there are 5-15 pieces of information for each of the 6 robots on the playing field. I had a couple of thoughts, 1.) take the input from a php page, and use it to create a table in the database. 2.) To somehow store the schema as a text string, and the same
How can I show a date popup box that formats the date so it will fit in the mySQL date field? Also, how can I check or format time to fit in the mySQL time field? $mysqldate = date( 'Y-m-d H:i:s', $phpdate ); $phpdate = strtotime( $mysqldate ); edit: This and Everything else about date/time in PHP, and how to use it with MySQL, is in the wonderfull PHP documentation: http://be.php.net/datetime It sounds like you're looking for some kind of widget to allow the user to enter
I wrote a custom query to use in CakePHP 1.3 The query is as follows: SELECT artists.id, artists.name, artists.image_id, genres.genre FROM artists LEFT JOIN coupling_artist_genre ON artists.id = coupling_artist_genre.id_in LEFT JOIN genres ON coupling_artist_genre.id_out = genres.id WHERE artists.name LIKE '%tee%' AND genres.id IN (12,14) ORDER BY artists.name ASC LIMIT 0,25 When I call this like this: $this -> Artist -> query ($sql); I get this
I have to write a query wherein i need to allocate a ID (unique key) for a particular record which is not being used / is not being generated / does not exist in database. In short, I need to generate an id for a particular record and show it on print screen. E. g.: ID Name 1 abc 2 def 5 ghi So, the thing is that it should return ID=3 as the next immediate which is not being generated yet, and after this generation of the id, I will store this data back to database