mysql

SQL query not returning results when expected

I am having trouble with my queries not returning any results. There are no errors in the query but i expect to see a result and i don't get any Here is my table structure CREATE TABLE IF NOT EXISTS `boards` ( `boardid` int(2) NOT NULL auto_increment, `boardname` varchar(255) NOT NULL default '', `boarddesc` varchar(255) NOT NUL...

can full text search be enabled on views? mysql

can full text search be enabled on views? mysql ...

MySQL query with dependent subquery takes too long

I need an SQL guru to help me speed up my query. I have 2 tables, quantities and prices. quantities records a quantity value between 2 timestamps, 15 minutes apart. prices records a price for a given timestamp, for a given price type and there is a price 5 record for every 5 minutes. I need 2 work out the total price for each period, e...

php image uploads

Hi Im wanting to accept image uploads onto my server. When a user uploads an image to the server I want to store its location in a database table. tblPictureStore: pictureid | serverlocation | caption | date added How can I do this? Also, How could I set up my add_Images form to quickly accept multiple uploads in one go, without know...

MySQL/PHP - Would putting quotes around numbers break any queries?

I want to have a generic PHP function that builds a mysql query based on the parameters of the function. Since it is generic the query may sometimes ask for id=123 or name='Bob'. I test out some queries with quotes around numbers, even stuff like WHERE id > '50' + 7 and it worked but I have my doubts that this won't cause trouble down t...

Selecting mysql field by logic expression

SELECT challenger_name as name, IF(challenger_timeout > challenged_timeout, (SET wins + 1), NULL) as wins, IF(challenger_timeout < challenged_timeout, (SET lose + 1), NULL) as lose, IF(challenger_timeout = challenged_timeout, (SET draw + 1), NULL) as draw FROM time_trial_...

Is there a performance difference between BETWEEN and IN with MySQL or in SQL in general?

I have a set of consecutive rows I want to get based upon their primary key, which is an auto-incrementing integer. Assuming that there are no holes, is there any performance between between: SELECT * FROM `theTable` WHERE `id` IN (n, ... nk); and: SELECT * FROM `theTable` WHERE `id` BETWEEN n AND nk; ...

GridView, ObjectDataSource, and Custom Pagination with MySQL

I am trying to hook up custom pagination with an ObjectDataSource to my GridView. However, this thing renders no data, but does render the column headers. The debugger clearly indicates a populated DataTable being returned: <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" AllowPaging="True" /> <asp:ObjectDat...

Obtaining metadata from MySQL in Java

Possible Duplicate: How to get equivalent of ResultSetMetaData without ResultSet StringBuffer queryBuffer=new StringBuffer("SELECT * FROM "+tableName); PreparedStatement preparedStatement=getConnection("root", "").prepareStatement(queryBuffer.toString()); ResultSet resultSet=preparedStatement.executeQuery(); ResultSetMetaData ...

HTML 1 click delete from MySQL database

Hey Guys, how would I create a link that would when clicked erase a record from a MySQL database based on the id of that item? using php if possible. edit// The link will require authentication in order to view Thanks ...

How to handle database access in Zend Framework?

Hi, To begin: i'm not an expert in Zend Framework and doing something terrible wrong. I'm sure of that. I think there's something wrong with my design patterns. As an example: I'm building access management with Zend_ACL (Access Control List) There are three tables in the database: roles resources permissions the permissions table ha...

Securing mySQL data

Hi guys, I am inserting data into a mySQL database, but I am inserting banking details so it is very sensitive, how can I secure it and protect against it getting into the wrong hands? At the moment the code is still very basic, without any preventative measures in place, mysql_connect("localhost", "user", "pass") or die(mysql_error())...

Can I automatically locate the MySQL executable from PHP?

Hi guys, I need to run Shell_exec to import a dump into my MYSQL database. Today I do this: $shellExec = 'C:\wamp\bin\mysql\mysql5.1.36\bin\mysql -h localhost -u root mertero_decicare < D:\localhost\sql\decisions.sql'; $out = shell_exec($shellExec .' 2> output'); Which works. But is there a way to 'find' the location of the mysql ex...

How to troubleshoot why MySQL query is causing site to stop?

I have this script I made that first creates a temporary table containing all the products for the current category. Then I have a search class that creates a temporary table and inserts products into it from various different querys on the table it is searching (the temp table for the category). This is so when looking at a product ...

Backing up very large MySQL DB

Hi What is the best way to backup very large MySQL database (Gigas of info)? ...

implement a button to send information to another php file?

Hey guys, I've got the following php code printing out the contents of a SQL table. $query="select * from TABLE"; $rt=mysql_query($query); echo mysql_error(); mysql_close(); ?> <i>Name, Message, Type, Lat, Lng, File </i><br/><br/> <?php while($nt=mysql_fetch_array($...

Sanitize Silverlight input

Hey, I have a silverlight application that allows the user to modify their username, password, bio etc. This information is stored in a MySQL database and retrieved used a WCF webservice. I need to sanitize all information received from the user before it gets into the database. At the moment I can't store apostrophes in my DB. Where is...

A better way to "Clear" all tables using Entity Framework.

Hi currently when I want to clear my tables I use brute force: inventario_dboEntities inv = new inventario_dboEntities(); foreach (var item in inv.espiromex_dampers) { inv.DeleteObject(item); } foreach (var item in inv.espiromex_detalles) { inv.DeleteOb...

Add Up All Mysql Values PHP

Hey, I have a tables called downloads, and in that table it stores the total amount of downloads for each day, so like downloads date 586 07-16-2010 906 07-17-2010 1019 07-18-2010 287 07-19-2010 15 07-20-2010 639 07-21-2010 337 07-22-2010 How could I retrieve the total number of downloads, so add them all up from every singl...

MySQL: How to "sum" product weight if the product are in different lines

I have to sum the weight of the certain products, but they are in different lines of MySQL. How to do it? Here is an example of my database: ID | Product_id | weight_kg | Quantity | 1 | 201 | 6 | 3 | 2 | 102 | 3 | 1 | 3 | 103 | 4 | 4 | 4 | 200 | 2 ...