Can i create nested tables on MySql?
for example,access example db, every student record have a nested table about guardians. http://img101.imageshack.us/img101/9881/53882937.jpg ...
for example,access example db, every student record have a nested table about guardians. http://img101.imageshack.us/img101/9881/53882937.jpg ...
I have two tables. ticket & ticketlist. The sold out column in the ticket table needs to be 1 if that item is sold out. Table ticket needs to be soldout when the count for that item in table ticketlist is 2. ticket ticketid, quantity, soldout 21 2 1 ticketlist ticketlistid, ticketid 3 2...
I'm building a web application that requires users to provide their location (similar to the way Facebook does it). I'm not sure on the best way to implement this. I require the ability to search through records of another entity (call it 'events') which also have a physical location attached to it, and match the users in the same or clo...
I have 2 products, one is a thousand dollars so for it's price I inserted into the database: 1000.00 and nother thats 34 dollars so I inserted: 34.00 But when I sort the products in order by price (low to high) the $1,000 product comes before the $34 one, why? The query: SELECT * FROM products ORDER BY price ASC; EDIT It's a var...
I don´t have a field as such, but I am making a new field which is the result dividing an existing field, i.e. cost/1.15 Is there a way to restrict the result of this calculation to two decimal places? ...
Hi, Looking for websites/books SQL queries from simple to advance (queries optimization and performanance etc.. ) questions and examples to exam for MySQL Job. Thanks ...
I have a table with an id field, set to auto increment. However, say I insert 10 records, and then empty the table, the first new record will be id number 11. Why is this, and is there a way to prevent it from happening? ...
Is there an easy way when inserting a new record to make it fail if one of the fields is a duplicate of one of the other fields? I don´t want the field to be a primary key or anything like that... ...
Hello, i have this 3 tables forums_forum +-----+--------+-------------+-------+-----+ | fid | name | description | index | cid | +-----+--------+-------------+-------+-----+ | 36 | gdghdf | hjghj | 54 | 5 | | 45 | yutuy | iuyi | 99 | 6 | +-----+--------+-------------+-------+-----+ forums_threads +----+--...
Does bool value false == 0 and true == 1 Does Null value in varchar, int, date fields == 0? When by default in mysql values == 0 or NULL or empty string? ...
Is there a way to set an IF statement in MySQL or PHP to write something to a column or not? What I want to do is completely skip a column so that "NULL" is written to it, in case there is no data to be submitted in the column. In case nothing is to be submitted to the database in one column, I want it to be NULL for that record obvious...
Hi all, i need to select A list showing the customer id, title, first name and surname of each customer who has hired a car, sorted alphabetically by customer surname together with a count of the number of bookings each of them has placed. I've done the first part but not sure where to put count for the number of bookings placed. Here...
I'm trying to figure out if it is better to store my user's data in a session cookie (like password, username, etc), and update that cookie only when I change the MYSQL database from my PHP, OR Store the user's username and user ID in a session cookie and reach out to the MYSQL database every time I need to get the user's data. Which ...
I have 2 tables, purchases and sales with each having a date field and a cost field. I want to generate reports of a few different types, for example I want to show profit and loss over each month or year, or to show how often a particular item sold for a given arbitrary time period ( probably based on user input) Is it terribly comple...
Possible Duplicate: Mysql Offset Infinite rows Is it possible to specify a query in MySQL with a 'offset' but without a 'limit'. For example: SELECT * FROM countries OFFSET 2 Fails, but: SELECT * FROM COUNTRIES LIMIT 8 OFFSET 2 Works fine. I'd like to just specify the offset. Thanks! ...
I set my database to require ssl. I've confirmed I can connect to the db via command line by passing the public key [and have confirmed I can't connect if I do not pass public key] I get the same error in my django app as when I do not pass a key. It seems I've not setup my settings.py correctly to pass the path to the public key. Wha...
I am trying to fill a dataset with the result of a stored procedure using MySql and Mono. The stored procedure takes in some values, creates a new row in a table and then selects some rows. When I try this I get back an empty dataset and my database does not have any new records. I have checked the basics: The Database is running and...
The Title really says it all. Something like: REPLACE INTO vips SET active = 0, inactive = 0 WHERE ip = 3494220867 AND proto = "https"; ...
So I have this messages database between members in my CMS. I wanted to change the listing to show people instead of specific messages. Call it "threads" but each thread in the "my messages" page is a member that you've had a conversation with, right? So, I obviously do this with something like this: select id, msgfrom, headline from m...
I've tried every method that I knows but didn't got the solution on "How to create an rss feeds and sitemap for a dynamic site that get updated automatically". ...