Concrete Data & Details
I'm reading available documentations and whitepapers, but can't reach specific answers to my questions:
1. What is the minimum requirements (cpu,memeory..) for mySql.
2. What is the advatanges in using the embedded version over the regular? And I'm looking for specific data, not 'global statements', like - how small is the embedded version's footprint?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Getting All Details For Minimum Value
I'm sure this can't be that hard, but suppose I have tables for category and product, and a link table, and I want to get the minimum priced product for each category: select c.categoryID,c.categoryName, MIN(price) as min_price FROM cat c JOIN category_product cp ON c.categoryID=cp.categoryID JOIN product p ON cp.productID=p.productID GROUP BY c.categoryID That's fine, but how about if I wanted to get further information about that minimum priced product? I've been doing what looks like awkward things with subqueries, like this: SELECT cat.*,(SELECT productName FROM product WHERE product.price=cat.min_price LIMIT 1) as prodname FROM( select c.categoryID,c.categoryName, MIN(price) as min_price FROM cat c JOIN category_product cp ON c.categoryID=cp.categoryID JOIN product p ON cp.productID=p.productID GROUP BY c.categoryID ) as cat or this : SELECT cat.*,p.productID, p.productName FROM( select c.categoryID,c.categoryName, MIN(price) as min_price FROM cat c JOIN category_product cp ON c.categoryID=cp.categoryID JOIN product p ON cp.productID=p.productID GROUP BY c.categoryID ) as cat LEFT JOIN product p ON cat.min_price=p.price GROUP BY cat.categoryID
Product Details
I am currently developing an e-commerce website. Each product comes in many colours and sizes. I have therefore created the following tables: 1. product (contains basic information about each product) 2. colour (contains a list of all possible colours) 3. size (contains a list of all possible sizes) 4. product_colour (contains matching product and colours ids) 5. product_size (contains matiching product and size ids) I now need to create a query which returns the basic information, the available colours, and the available sizes for a particular product id.
How To Add Several Details To One Field In Table?
I have been adding my info into my database so far like this: INSERT INTO mytable SET Name = "Harry Bucket", Products = "chair", Suburb = "sydney", ResLink = "harrys_page.php"; BUT, harry has more then just a chair under his product listing... how would i add several products that relate to the 1 field?
Get Last Records Details With A Subselect?
I have a ticketsystem where each ticket belongs to an user and each user can insert a couple of messages to one ticket. Therefore I have implemented a date field (used as primary key). Now I want to get details from the last entry belongs to a ticketid. kdn_message: updated (date) ticketid (int) kdnr (int) detail state select * from kdn_message t where updated in (select max(updated) as updated from kdn_message group by ticketid where ticketid=t.ticketid order by updated desc) what is wrong i this statement?
Entering Session Details
I want to get the session details (username) of a person loged in. And want that details to be entered to a separate table in he same data base. how can i do that. A coding for that would e perfect.
Sharing Login Details
There is no decent image gallery that can be put with Joomla or Mambo CMS so I am wanting to add a separate pop up page to use a 4images (http://4homepages.de) image gallery. HOWEVER, I don't want my users to log in twice to two different databases! I'm sure there is a way of doing this. (both the CMS and the Gallery are on the same server, and they can both use the same Database.
Sharing Login Details
There is no decent image gallery that can be put with Joomla or Mambo CMS so I am wanting to add a separate pop up page to use a 4images (http://4homepages.de) image gallery. I don't want my users to log in twice to two different databases! I'm sure there is a way of doing this. (both the CMS and the Gallery are on the same server, and they can both use the same Database. )
Deciphering Connection Details From PhpMyAdmin
I have no details as to how to connect to my database although I am able to create one through phpmyadmin. While I twiddle my thumbs waiting for my host to send me some connection details is it possible to maybe work out what they are? I'd guess my username and password are ones I chose and are the same for the whole kaboodle so it's the address of the db I'm looking for, any clues?
How To Save People's Details Using MySQL?
Basically i want people to enter in there name and contact details and an answer to a simple question. I then want that information to be stored somewhere, so i can retrieve it once a month. Do i use Microsoft access?
Finding User Details Inside UDF
i heared that its possible to get user details inside the UDf by adding the mysql_priv.h header file. But where will this file be available. i am using MySql 3.23.52 on linux8.0 when i try to compile it says :"mysql_priv" file not found. If i can include this file, i can get the thread constructor called...
Can MySQL Return Details On What Specifically Trigged A Match?
Can MySQL return details on what specifically matched in each row for a FULLTEXT search or WHERE clause? Say the query "SELECT id FROM users WHERE (name LIKE '%Sarah%') AND (age BETWEEN 19 AND 29)" returns 12 rows. Is there a way for mysql to tell me whether name or age triggered the match?
Does Mysql Store Max Size For Data Type Each Time, Or Only What Is Needed For Specific Data?
If I use MEDIUMTEXT, which (if I understand correctly) has a max size of 65k, does mysql use the entire size each time data is written to that column? I have a text field on my site that users fill in, but more often that not, they don't. However, when they do, it can be 1000 bytes or more. Am I wasting space using MEDIUMTEXT or does mysql only set aside 1000 bytes for that column if the data is only 1000 bytes?
How To Export Data From Phpmyadmin Into LOAD DATA INFILE Syntax
I have a table with a lot of data (several millions of records). I would like to export the data using phpmyadmin into a SQL file. I know that phpmyadmin has an export feature. I need the exported data to be in the LOAD DATA INFILE format after the export. Is there a way to achieve this? Regular export uses the INSERT INTO ... syntax for the data.
LOAD DATA INFILE To Import Data Exported From A MS Access Xp
I am trying to use LOAD DATA INFILE to import data exported from a MS Access Xp table. But all i get in the date field is 00:00:00, as Access exports DATE and TIME and MySQL seems to use just the TIME portion of this. Is there any way to ahve MySQL import just the DATE portion or is there any way to have Access export only the DATE portion?
What MYSQL Data Type Can Hold Multiline Text Data?
say a file: name#1 (start) line2 line3 ... line14 (end) name#2 .... name299 .... <eof> It's really too messy to split into fields, file process and put it in tabular format. Every 14 lines there's a new "record" - I use the term record very loosely because by record I mean one data item eg. The new "records are separated by name# - so when I see a new name# I know it's a new "record". So in mysql I might have one primary key and just one other filed per a record that would be multiline text. What I an specifically asking is: What MYSQL data type can hold multiline text data?
Split Innodb Data File Into Smaller Data Files
we configured innodb configuration with default my.ini settings. now data file is increased more than 40 GB.After that we come to know that we need keep the settings like below #innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend so that it will keep on creating 2GB data files. Now how we can change the settings and splitting the data file of 40 gb please.
Help CHECKING FORM DATA AGAINST MYSQL TABLE DATA
PHP // See if relevant fields have been set. $submitted = IsSet($_REQUEST['Submit']) ? TRUE : FALSE; $user = IsSet($_REQUEST['username']) ? cleanValue($_REQUEST['username']) : '' $pswd = IsSet($_REQUEST['password']) ? cleanValue($_REQUEST['password']) : '' if($submitted) { // Form submitted yet? if (empty($user) || empty($pswd)) { // Are Form fields empty? // Display error message when fields are not filled in. $message = 'Make sure you enter both a username and password.' } else { /* THIS IS MY HUMBLE EFFORT BELOW AND IT DONT WORK HELP */ //CONVERT PASSWORD FROM FORM INTO MD5 $pswd = md5($pswd); //CONNECT TO DATABASE $connection = mysql_pconnect("$dbhost","$dbusername","$dbpasswd") or die ("Couldn't connect to server."); $db = mysql_select_db("$database_name", $connection) or die("Couldn't select database."); //SELCT TABLE AND DATA $sql = @mysql_query("SELECT * FROM users WHERE username='$user' AND password='$pswd' AND activated=Ƈ' "); if (!$sql) { exit('<br /><br /><h3>Error retrieving Art members from database!<br />'. 'Error: ' . mysql_error() . '</h3><br /><hr /><br />'); } //MAKE VARIABLES FOR CHECKING FORM DATA AGAINST IS THIS RIGHT!! while ($login_check = mysql_fetch_array($sql)) { $user = htmlspecialchars($login_check['username']); $pswd = $login_check['password']; //NOT SURE FROM HERE // ORIGINAL SCRIPT BELOW // Authenticate username and password (i.e. match against a database). // Start a session only after username and password have been verified. THIS IS THE EXAMPLE LOGIN CHECK THAT CAME WITH THE CLASS if ((!strcmp($user, 'empl')) && // Does username match 'empl'? (!strcmp($pswd,'demo'))) { // Does password match 'demo'? $sess_param['new_sid'] = TRUE; // Create new session ID to be safe. $sess_param['security_level'] = 100; // Security level for Employees area $sess_param['gc_maxlifetime'] = 300; // Inactivity timeout of 300 seconds (5 minutes) $sess = new DB_eSession(&$sess_param); // session_start() done. $sess->setSessVar('authenticated', TRUE); // Set that authentication occurred. // Save the username for displaying and encrypt $sess->setSessVar('username', $user, ENCRYPT_VALUE, EXTRA_FIELD); $URI = $sess->setSessURI('employees.php'); // Optional - pass session ID in URI. Not as safe. header("Location: $URI"); // Go to members area. exit; } REGARDS Bill007
Add Additional Data To Existing Data In A Blob Field
I have a Blob field called "category" that we use to store different categories of job types that our users set up so they receive emails based off of the ones that they have picked. What I need to do is to add 4 new values to the beginning of each users "category" field. I am not really sure how to do this except that I might need to use UPDATE to get it done. This is where it will get tricky, I need to check for the 4 values to see if they already have them and just add the oines that they don't have. Here are the 4 values that I need to check for and add. Allied Health Care, Nursing, Rehab/Therapy, and Other/Pharmacy/Physicians. Here is what a current list of values would look like in the users table and the category column: Code:
Data Truncation: Data Too Long For Column 'DESCRIPCION' At Row 1
I'have this problem when i try to insert a simple text in a column VARCHAR (40). If I exceed the 14 chars size, this exception is fired. I'm working with the mysql 5.0.41 and fails in the query browser and in my java app with the conector 5.0.6. I'd tried to change to UTF my table, change to a VARCHAR(100),change to CHAR (100) and nothing it's function.
Restore Data By Copy The Data File
i have restored the data by copying the data file into c:mysqldataabc It works. But, I have the problem as I want to copy another updated data files (*.frm, *.MYD, *.MYI) into the folder. All data is lost! but, the size of the data file is not zero. If I do the same action to replace the old data files, it works again. Now, how would I can restore the updated data?
Cant Get Data
i have 1 mysql database name data1.. then in the database have 3 column .. named with id,name,item..this database is for keep list of item that customer have purchase.. what i want to do is to collect list of item which the person purchase..so it will display name and item of purchase when i enter id for request query.. i try with this code but it doesn't working. when i run this command it will read the first row of the table and if the id didnt match with the id in first row of the table it will run the else command. Code:
Data Cut Off
I am running a query in Navicat that is pulling data from a MySQL database. The query pulls all the data, but it is cutting off fields. For instance, an address that is "123 Anystreet" in the db will say "123 Anys". I ahve never seen this happen before. Does anyone know the cause of this? This query takes about 30 mins to run and pulls over 2000 records. I do not know if that has anything to do with the problem. Here is the query: Code:
Data Set
I installed Mysql5.0.27 several days ago, and 'Error 0' occured when redeployed Mysql server later. So I backuped the data in 'INSTALL_PATH/MySQL Server 5.0/data/'. Then I reinstalled Mysql, and copy the backup data into the folder 'INSTALL_PATH/MySQL Server 5.0/data/', but the system can't find the data now. The data is very important for me! What is reason? How can I get the data?
Contains Data
I was just wondering if there is some code that I can write that says "Show me the data from this column, but only the ones that contain data" e.g. SELECT CONTAINS(table) WHERE .....
UDF And Row Data
Is is possible to create a UDF that accesses the row data for the current query? For instance, I want to do like: SELECT * FROM tbl WHERE myUDF() and in myUDF(), it checks values from the current row in tbl and returns true (1) or false (0).
Add Data To The DB
I just created a new table with lots of fields, but how do i add dat into it using phpmyadmin??
UDF And Row Data
Is is possible to create a UDF that accesses the row data for the current query?For instance, I want to do like: SELECT * FROM tbl WHERE myUDF() and in myUDF(), it checks values from the current row in tbl and returns true (1) or false (0).
Way To Have Data
I essentially have a thesaurus that I would like to put into a MySQL database. What would be the most efficient way to do so? My best idea to date is putting the root word as a column name, and letting its synonyms be rows? Is this a good method, or is there a better way?
Getting At Old Data
Here what I have set up, a database with a table containing, the title, main section, date posted, and ID(auto_inc) its for a blog. 1. On the left hand side display, I want to show the 2 newest entries, not including the first newest, which is displayed in the middle as the main entry. How can I grab the data from the 2nd and 3rd oldest entries? 2. Once I get these entries, titles, and dates, how can I only take say the first 50 words of the entry, after that I will put a link to the full story (which I know how to do), I'm just not sure how to only display the first 50 words.
UTF Data From 5.0
i have one text field in my table and it stores data in arabic and i am using UTF 8 as the character set.now what i want is to take the data from that server and dump it into another server which is running in mysql 4.0.when i did that it is not displaying arabic properly.how to solve this problem.i thing the UTF8 data from 5.0 is not compatable with 4.0 how solve this
Data In Tow
how can create two database in MySQL such that save in different directory.
Using Data
Is it possible in MySQL to use UPDATE to update fields in one table = with data from another table? For example, the following code seems to be the answer but fails with a syntax error in MySQL: =20 UPDATE test_demo1.products SET nontaxable=3D(SELECT IMFSalesTax FROM IDX.InvMasFile); =20 Here the data from the field IMFSalesTax in table InvMasFile, database = IDX, is being used to update the field nontaxable in table products, database test_demo1. =20 Any suggestions/workarounds will be greatly appriciated. =20 =20
How To Select Data 1 Day Before...
This has got me scratching my head. I'm trying to select data 1 day before the expiry date, but too no avail. Here's my code (by the way, I'm using MySQL client version: 5.0.27 on my PC and MySQL client version: 4.1.21 on the web server): $endresult = mysql_query(" SELECT photo_id, photo_caption, photo_category FROM gallery_photos WHERE photo_expire_date = DATE_SUB(CURDATE(),INTERVAL -1 DAY) "); The dates are placed as for example: 2007-02-17 into the database.
Need Help Moving Data Over
I am moving my forum to a new host, the old host is on linux, the new host is on windows. My biggest problem is that the only access I have to my current database is PHPMyAdmin, this is not installed on my new host, and I have thus far been unsuccessful in trying to configure it. I am able to connect remotely to my new hosts database. Is there any tool that will allow me to export my data through PHPMyAdmin, and import it into my new database? I have tried the official tool from MySql, but it will only import sql files that were made using it.
Query - Not Getting Data
I think this is probably the right forum to post this in as I have a query which I'm sure is causing the problem. The problem is that I am finding hard to come up with a query that gets each authors name using the isbn from the titles table which then checks against the title_author table which I then need to get the actual authors name from the authors table. I have these table structures: Here is my MySQL query: SELECT title,subject,isbn,year_published,author FROM titles,authors WHERE (year_published >= 1985) AND (title LIKE '%SQL%') AND (title_author.isbn = titles.isbn) AND (title_author.au_id = authors.au_id) ORDER BY year_published DESC Basically the information I am having trouble sift out is the correct author name for each book - using the isbn to identify each book. However I am not getting any results back with this query and I know that when I remove certain things that I have added to get the author for the correct book I do get results. This is the query that works when I do not need the authors' name. SELECT title,subject,isbn,year_published FROM titles WHERE (year_published >= 1985) AND (title LIKE '%SQL%') ORDER BY year_published DESC Here is my php code as well but this is not totally relevant to the problem. PHP <html> <head> <title>Titles about 'SQL' published since 1985</title> </head> <body style="font-family:tahoma"> <h3>output from 'biblio' database :</h3> <hr> <h4>titles published after 1985 ... </h4> <!-- php script that connects to database --> <script language="php"> // file that sets up the connection to the database. // leave this line in! include 'biblioConnect.php' </script> <!-- php script that queries database --> <script language="php"> // 'mysql_query()' function stores result of query in 'result' variable. // edit query of biblio database here : $result = mysql_query(" SELECT title,subject,isbn,year_published,author FROM titles,authors WHERE (year_published >= 1985) AND (title LIKE '%SQL%') AND (title_author.isbn = titles.isbn) AND (title_author.au_id = authors.au_id) ORDER BY year_published DESC "); </script> <!-- php script that processes output of mySQL query using loop --> <script language="php"> // if result contains any information ... if ($result) { // find number of rows in output from mySQL query : $num_rows = @mysql_num_rows($result); if ($num_rows <1 ) { print "<p>No valid database entries found!</p> "; } else { // loop through each of the rows one at a time : for ($row=0; $row<$num_rows; $row++) { // extract record from result : $record = @mysql_fetch_object($result); // print out HTML that includes fields from the current record : print "<p style='border:1px solid #888; background-color:#bfc; padding:1em'>"; print "<b>$record->subject :</b> <i>$record->title</i>"; print "<br /><b>Author: $record->author</b>"; print "<br />"; print "<b>isbn :</b> $record->isbn ($record->year_published)"; print "</p>"; } } } else { // result variable contains no information : print "<p>No information extracted from 'biblio' database.</p>"; } </script> <hr> <div align="right"><b> <!-- php script to print out current date and time : --> <script language="php"> // use 'date' function to store current time and date in 'now_time' : $now_time = date("M j, Y, G:i:s"); // print 'now_time' into the document : echo $now_time; </script> </b></div> </body> </html> I am sure this is not a difficult problem for some of you who are very good with queries - I am just trying to give you as much information as possible.
Copying Data
I want to copy some columns in a table of a database to another table in different database. How can I do it?
Cleaning Data
I'm about to inherit a MySQL instance full of tables themselves full of data which has plenty of holes. Is there an accepted standard in cleaning it up?
Length Of Data
if I make a column INT(255), and I know 100% sure that no data will be no more than 5 numbers long, am I *using* any extra CPU resources, or is it exactly the same?
Getting Data Into MySQL - Please Help Me!
I have a database with 3 fields: id, Keyword and Body. They id and Keyword fields are already populated. My webpage template puts the Keyword field data as H1 text for the page title. The Body field data is currently empty. On my webpage, I will have an include where I pass the Keyword field data to a script that will draw in results based on that keyword. e.g. something like <insert here text based on current Keyword for page> My question is, how can I get this data into the Body field in the MySQL database? There will be about 10,000 entries in total. I can display the <inserted> data into the webpage but I really want it stored in the Body field.
Data Corruption
I run a small online business and have recently found something shocking and difficult to explain in my database. A customer placed an order in early October, for three items, one of each item. We are certain that it was one of each item, as confirmed by the PayPal payment, as well as the internal email order notification which listed the quantities. However, in revisiting that order today, the database reports the following quantities: 13, 5, 3 What? I have looked through our (rather sporadic) database backups and found the following numbers: October 5, a day after the order, those quantities are correct (1, 1, 1) October 22, those quantities are skewed, but not all the way!? (12, 4, 3) October 31, it's the same as before (12,4,3) November 11, it's changed (12, 5, 3) November 18, it's changed again (13, 5, 3) Here is the relevant table schema: mysql> describe cart_products; +-----------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------------+--------------+------+-----+---------+-------+ | cart_id | int(11) | NO | MUL | 0 | | | prod_id | int(11) | NO | | 0 | | | quantity | smallint(6) | YES | | 1 | | | extra_part_name | varchar(255) | YES | | NULL | | | prod_type | smallint(6) | NO | | 0 | | +-----------------+--------------+------+-----+---------+-------+ There are 4088 rows in the table. Could this be a case of data corruption? I"m particularly weirded out by the incremental increases in the quantities. I have found one other order which is affected in a similar manner.
Dumping Data
Is there anyway to dump all the tables columns info and rows of data ? Like you can with phpmyadmin, but just without using it :P I have afew tables on my old desktop that i never saved the table info of and can't be arsed retyping it :P plus i wanna keep all the data of course I tried installing phpmyadmin on it ages ago, but it ****ed up (which in turn was a good thing 'cause it forced me to learn to do things properly without the help of that), so yer...
Best Way To Store This Data
I'm doing a bit of a site where users can upload replays of games. The table (called 'replays') will have fields like id, name, date_uploaded .... which take up about 10 feilds. But there also has to be a way to store data on each player. There can be up to 8 players in a game and the database must somehow record: a) the name for each player b) a rating for each player c) and a second rating for each player. Any tips on how to do this? I cant imagine having a database with 40+ feilds called player1rating1, player1rating2, player2rating1
How To Get Data Between The Two Dates?
i'm using the between operator to list all the transaction between the dates and it's working fine. But i want to list all the transaction from a table including the startdate and the enddate.
|