is there a better way  

I have a column called priority that's an INT.When I INSERT, the value in priority defaults to 0.When I ORDER the column the zeros go to the top of the list.I want them at the bottom of the list so I simply recode all zeros to 99. That solves my problem,... Continue Reading
Views : 83
Friday 28th of December 2012

Next Record by Order  

Good day,I've been trying to figure out a way to get the next record by order.Say I have 10 records and an 'order' column/field in the table being 1, 2, 3, 4.....9, 10.So I start at record with 'order' 1 and I need to select the next, it will be 2, etc. Continue Reading
Views : 97
Friday 28th of December 2012

Flash Builder mobile Application. Php Mysql Error 1048: Column item cannot be null  

I created a table Code: CREATE TABLE basket (id INT NOT NULL AUTO_INCREMENT, item VARCHAR(50) NOT NULL, amount VARCHAR(50) NOT NULL);and try to create an... Continue Reading
Views : 74
Friday 28th of December 2012

Basic help needed  

HiAt a very late stage in my life I am trying to learn mysql and php and hope someone can just point me in the right direction. I find it quite difficult to learn from a book no matter how well written.I believe I have set my basics correctly, I am using wamp to access... Continue Reading
Views : 81
Friday 28th of December 2012

[MySQL 5.0.45-community-nt-log] Remove Duplicate Data or Rows  

Hello guys!How do I remove duplicate data or rows from a MySQL query in the table with more than 10.000.000 rows?Could you please help? Thanks you very much for your help. Continue Reading
Views : 68
Friday 28th of December 2012

What is FULTEXT for purpose of natural-language searching  

Hello,We want to do search of certain fields in our DB, these fields are VARCHAR.I see from MySQL that natural-language searching is possible with command like:SELECT * FROM submit_web_data WHERE MATCH (title, descpt) AGAINST ('hotels in Paris');But... Continue Reading
Views : 45
Friday 28th of December 2012

Multiple Loops Producing Slow Script Execution  

I'm trying to get my head around the best database design from a speed perspective.I've got 3 tables.Table A - StationsTable B - SongsTable C - Station PlaysRight now I'm procedurally walking through the steps. PS I Continue Reading
Views : 151
Friday 28th of December 2012

Fetch related rows from tags  

I'm using a 2 table tagging system for articles (myisam) and I'm trying to get related articles based on the tags and category_id of the article currently being viewed.What would be the optimal query to achieve this? I only seem to be able to find answers for 3 table tag... Continue Reading
Views : 77
Friday 28th of December 2012

SELECTing for something that isn't in the table (or WHERE NOT...)  

I'm doing a feasibility study for an accommodation booking database. I have two tables as shown below (there are some other fields in the 'rooms' table, which I've omitted here). Code: Continue Reading
Views : 80
Friday 28th of December 2012

How to compare between mysql datetime field DateStart and DateEnd  

Hello guys!I need your help.I have two fields date in my table MYSQL:Field DateStart 2012-05-01 12:00:00;Field DateEnd 2012-05-05 12:00:00I need extract in output the greater of the two dates, in this... Continue Reading
Views : 78
Friday 28th of December 2012

Installing MySQL on Mac OS X Lion 10.7.5  

Hi, I'm reading PHP & MySQL Novice to Ninja (5th edition). I've installed MySQL in Mac OS X Lion (10.7.5) but when I go to the terminal (following instructions in Appendix A) and write: "sudo /usr/local/mysql/bin/mysqld_safe", I get this message: Continue Reading
Views : 51
Friday 28th of December 2012

[SQL Server 2005] Between syntax  

Hi all, I return after time because I have problem with this sql query in my DB Sql Server 2005.I need this output: Code: Continue Reading
Views : 127
Friday 28th of December 2012

Why is this query taking forever to run  

Hi,I have a table with a few 100K records. I have an index on column PiNumber - but when I run the following query in phpmyadmin it will run for 30+ minutes ... Code MySQL: ... Continue Reading
Views : 77
Friday 28th of December 2012

Query Optimisation Help  

Hi,I'm currently working on a project that structures content using a versioning system. There are 2 database tables that make up this structure:wr_items - This holds the core information about an individual item, such as it's latest status, date created and... Continue Reading
Views : 70
Friday 28th of December 2012

Need some help with sql urgently please  

hi i have an assignment dude tonight and as usual i have left it to the last minute >< . I am having trouble with the last 3 questions and if u are able to help i would really appreciate it i will donate $10 to a charity or your website the tables are BOOKING Continue Reading
Views : 86
Friday 28th of December 2012

Outer apply query  

Hey guys, I'm trying to reach some table variables with the help of outer apply. The query i got so far is this. Code SQL: Continue Reading
Views : 88
Friday 28th of December 2012

Getting the total quantity of each item in a table  

Good day,I am working in an online website for selling books.There is a table where the sold books are stored, like this:Purchases======id | int - autoincrementDateCustomerID (foreing key to table Customers)BookID (foreign key to... Continue Reading
Views : 78
Friday 28th of December 2012

Get mysql query joined outside while loop  

I have a multiplayer game site where a user get his list of games like this every 20 second: PHP Code: Continue Reading
Views : 57
Friday 28th of December 2012

Database Architecture Help  

Hey guys,I am no database expert. I have worked with databases for a long time, but do not have experience with the best practices, so am asking some advice here hoping for some help Continue Reading
Views : 186
Friday 28th of December 2012

xampp phpmyadmin password set  

i was trying to set a password for a db_table in phpmyadmini tried inserting this below code in the "sql" tab PHP Code: Continue Reading
Views : 112
Friday 28th of December 2012

[MySQL 5.0.45-community-nt-log] [Err] 1093 - You can't specify target table...  

Hello guys,I am currently getting the error [Err] 1093 - You can't specify target table 'tbl_login' for update in FROM... Continue Reading
Views : 92
Friday 28th of December 2012

MySQL Workbench and Primary Keys  

Hi,I am using MySQL workbench for the first time. I have created an InnoDB relational database. When i connect two tables with a many to one connection it automatically adds a new row in the many table that references the row_id in the other table. When it adds this new row it... Continue Reading
Views : 72
Friday 28th of December 2012

mysqldump multiple tables on multiple --where  

Ok, so what I'm trying to do, I'm not even sure is possible, but if it were it would make life a little easier.So I have a database that has multiple tables. I want to mysqldump some of those tables and some of them mysqldump on a certain where. All of this inside a single... Continue Reading
Views : 52
Friday 28th of December 2012

prevent duplicate entries  

I have a mysql table to hold my members. I want to prevent people from writing to the database using the same email address. so im thinking my php code would be something along this... PHP Code: Continue Reading
Views : 46
Friday 28th of December 2012

Help with removing entries from a phpMYadmin table  

How do I delete all the entries in a phpmyadmin table without deleting each one manually?Is there a way to delete a large amount of entries (but not all) from a phpmyadmin table without doing it manually?thanks Continue Reading
Views : 47
Friday 28th of December 2012

Add instead of update in MySQL  

Is there a way to use update to add a number to a database field instead of replacing it.For example currently when I update a field containing a 5 with the number 6 it just replaces the 5 with a 6.I'd really like it to just add the new number to the existing one - in... Continue Reading
Views : 41
Friday 28th of December 2012

SELECT statement with wildcards in table name  

What is the way to write a SELECT statement to retrieve data from several tables with the same name pattern. I'd like to select data from these tables: table_2012, table_2013, table_2014... I only want the tables that have the prefix (e.g. table_) and exactly the four characters for the... Continue Reading
Views : 80
Friday 28th of December 2012

Database design & normalization resources  

Here are some excellent articles on database design & normalisation - most are written with Access in mind, but 99% of the principles and techniques apply to every database under the sun, so they are well worth a read no matter which DB you use! Continue Reading
Views : 53
Friday 28th of December 2012

Join Error  

Trying to apply something that was shared here before in a different situation and keep getting an error but for the life of me can't see what I'm missing. A fresh set of eyes would be appreciated (or maybe I'm going about it wrong)Error: "Syntax error (missing operator)... Continue Reading
Views : 142
Tuesday 27th of November 2012

Need help with formatting a Query  

We had a survey done, with many questions and possible answersthe survey was handled by two tables within our DbA table that handled the questionsA table that recorded the answers to those questions.The Questions were multi-choice, choose one, and write... Continue Reading
Views : 128
Tuesday 27th of November 2012