Primary Key Name  

Hi,I have a question about how to name the primary row id key in my MySQL tables. Is it good practice to use the same naming convention for the primary row id field in every table e.g. "row_id", or should i name them all uniquely e.g. in the users table call it "users_row_id" and... Continue Reading
Views : 3675
Monday 31st of December 2012

requirements changed in to do it  

Hi I have 2 tables, faq and faq_categories...i have a join that work, and so far, I was a happy camper. But...requirements change, and i have to change the join, but i don't know how to do itHere is the current code that works just fine: Continue Reading
Views : 418
Monday 31st of December 2012

[MySQL 5.5.24-log] Error in output query  

hello everyone, I hope your help.I can't understand why different output between these two queries.Can you help me?Thanks in advance.The correct output: Code: Continue Reading
Views : 407
Monday 31st of December 2012

two unique indexes  

hi allIf there are 10 columns in the tablethen can we set "index type" = "unique" for 2 or more columnsOr is it limited to only 1 column ?vineet Continue Reading
Views : 587
Monday 31st of December 2012

Inventory Report  

My database with the following table:ITDetail Table:InvTrans Table:Currency Table: Continue Reading
Views : 507
Monday 31st of December 2012

Is there a better way to relate a web page to a row in a database  

We currently use a CMS we developed in-house. It's not a full CMS, as it just contains things like the contact name for a given web page, page title, and some other details, but not the content.As it is now, each page is "linked" to its row in the database by the page URL (minus... Continue Reading
Views : 390
Monday 31st of December 2012

string comparison question  

Hi,been away for a while and am obviously rusty. Please assume 'today' is Saturday.I am trying to output the days on which a product is available either... Continue Reading
Views : 460
Monday 31st of December 2012

Need help for my database design  

Hi, can i ask some help for my db design,i want to make cake ordering...but i have some doubt on my tables and my fields,i am not good in this db design,..I hope you can help me.Please see my attachment.Thank you in advance. Continue Reading
Views : 446
Monday 31st of December 2012

MySql Join 3 Tables  

Hi Everyone, How would I go about joining 3 tables at once? My database design/setup is at the below URL. I want the mysql statement to say "1992 Ford Explorer" Continue Reading
Views : 429
Monday 31st of December 2012

Using DISTINCT and COALESCE together  

Below is a query which gives me the Usernames of the Last-10 Visitors to a Member's Profile... Code SQL: Continue Reading
Views : 469
Monday 31st of December 2012

[Solved] Why isn't my triple join working  

Hey SP,I'm trying to join three tables. I want some items from table "item_inventory" to be displayed if they are appear in the right category and are also set as a "best seller". The best seller is set in a table called item_field_data. If there is a record in item_field_data... Continue Reading
Views : 510
Monday 31st of December 2012

Change column to autonumber (MSSQL)  

After six years of constant nagging from me, my office has finally implemented a copy of MSSQL to replace Access (Woohoo!), so I am now going through and making changes to my queries, which is going quite well.The one problem I noticed was that when the server people imported my... Continue Reading
Views : 425
Monday 31st of December 2012

How to paginate in case of SELECT * AGAINST   

Hi,When generating a LIST via SELECT AGAINST then LIMIT X, Y does not work.That is if the SELECT statemenet is like:SELECT ix_id, title, descpt FROM customers WHERE MATCH (title, descpt) AGAINST('$find') LIMIT 90, 100Rather than getting the... Continue Reading
Views : 440
Monday 31st of December 2012

Problems reinstalling mySql  

Hi all. I have problems reinstalling mySql. Two days ago I started to get problems setting up Datasources. The error stated that the connection to the database server had failed. When I tried to login in mySql I couldn't any longer so I decided to start from scratch but every time It doesn't... Continue Reading
Views : 518
Monday 31st of December 2012

SELECT by non-primary key  

I have a tableCREATE TABLE IF NOT EXISTS `reviews` ( `id` smallint unsigned NOT NULL auto_increment, `from` varchar(50) NOT NULL, `length` varchar(20) NOT NULL default '', `date` date NOT NULL, `providerid` smallint unsigned NOT NULL, PRIMARY... Continue Reading
Views : 449
Monday 31st of December 2012

locating phpmyadmin login  

So, I need to edit some content on a website that someone else built. It appears that it was built using joomla. have the ftp, but I don't know the login to joomla admin. ... Continue Reading
Views : 477
Monday 31st of December 2012

SQL and RDBMS Database Design DO's and DON'Ts  

This is a document I've been slowly adding to as I come across things 'in the wild'. Maybe it can be of some use?SQL and RDBMS Database Design DO's and DON'Ts------------------------------------------Generic DOs:Develop a backup... Continue Reading
Views : 481
Monday 31st of December 2012

Help with this simple query  

Ok, I am hoping someone could help me out here. I have a query which is not working properly and is driving me crazy.I have two tables data_table = my main working tabledaily_removed = same structure as main table, but less recordswhat I would like to do is Continue Reading
Views : 453
Monday 31st of December 2012

How to count a column correctly after join 2 tables  

Hi,I have these two tables and the following values Code: Table Popular Table... Continue Reading
Views : 318
Monday 31st of December 2012

Update TABLE from a Related Table with Multiple Entries (only wanting the latest val)  

The example below is not real, but if I can solve this, I know I can solve the bigger problem I have!Using MYSQL, I have two tables. Farm and Animals. Animals can have several items connected to farm with the "farmid" serving as a related key.FARM id ... Continue Reading
Views : 459
Monday 31st of December 2012

Grouping records by category name  

Table data structure is:link_id | name | url | category--------------------------------------------------------------------1 | SitePoint Forums | Continue Reading
Views : 591
Monday 31st of December 2012

Database and seach engine, with suggests, synonyms, full text search, etc  

Hi I'm searching a database with search engine to my job.We use vbulletin forum , and we want to create new landing to search threads and posts. But we can't use the vbulletin mysql database because in the future we will include other external results.I think this... Continue Reading
Views : 436
Monday 31st of December 2012

MySQL Foreign Key Issues  

Hi guys, I am a newbie with mysql. I am creating tables but i get stuck when it comes to foreign keys. I tried to remove the foreign keys and than paste the rest of the code, add an additional column of the foreign key but still its not working. Could someone assist me please. i will really... Continue Reading
Views : 405
Monday 31st of December 2012

[MySQL 5.0.45-community-nt-log] How do I insert a random value into mysql  

hello.It looks like RAND is what I need but I'm having a bit of trouble understanding how it works.I need to insert a random name between 1 and 3 into a table mysql, selecting these random name from a first table called listing_names.Table name is: listing... Continue Reading
Views : 374
Monday 31st of December 2012

Viewing a MDF database in Access 2010  

I have a database, Northwind.mdf. I want to view it in Access 2010 or any other Database Programs like Microsoft SQL Server 2012.Could someone help me through the steps to do this? Continue Reading
Views : 421
Monday 31st of December 2012

Order by count  

I have a query that orders results by the count of another table:"SELECT table1.*, COUNT( AS rev_count FROM table1 LEFT JOIN table2 ON = WHERE = 1 AND'$city' GROUP BY ORDER BY... Continue Reading
Views : 431
Monday 31st of December 2012

php - mysql count from morethan one table  

Hai folks,table1empno|salary-------------10 | 150020 | 275021 | 4000table2empno|department-------------19 | a24 | b31 | xi want a query to get the total records in both Continue Reading
Views : 460
Monday 31st of December 2012

database courses  

hi everyone, i need some information from you guys.actually i want learn database side courses,but i don't know what are the courses available other than sql,mysql etc..guys if you know about other courses please let me tellthnks in advance. Continue Reading
Views : 495
Monday 31st of December 2012

COUNT Causing Problems.  

Hi allWhat I have below works good and returns all the reviews depending on the venue_id selected. Code SQL: Continue Reading
Views : 401
Monday 31st of December 2012

Trying to optimize slow MySQL query  

You should have a look at "Using temporary; Using filesort". This is what is slowing your SQL down as it is writing to disk and sorting on disk. You might want to have a look at increasing the sort_buffer_size on your server to have the sorts performed in memory and not on disk. Continue Reading
Views : 449
Monday 31st of December 2012