Quick Question - Id Mediumint(8) - Does The (8) Matter?
just a quick question really..
Just setting up 1 of my tables and just wondering if it matters if i set my id to mediumint(8) but i only ever get to 6, will this effect anything in anyway?
Same goes for - address varchar(50) and say that no address ever reachs 50?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Does It Matter What Order My Tables Are In?
Does it matter what order your tables are in within a database and if it does how do I reorder them? Reordering columns and fields within tables is easy enough, yet I can't seem to find anything regarding the order of tables; which seems to suggest it's not important. Enlightenment please.
Does It Matter If Collation Is Latin1_swedish_ci?
This is odd, my web host installed WordPress software for me and it created a MySQL database. When I access the database through phpMyAdmin, it says MySQL connection collation is set to "utf8_unicode_ci", but in the database all of the tables show the collation set to "latin1_swedish_ci". This seems odd. I'm having problems importing a database and wonder if this is the problem. And, if it is, how do I reset the collation?
No Matter What I Try It Doesn't Return The Records!
This code works right it returns all records in userwindow as null except one which has uw.waction=2 this is right... but as you see on the second code i have tried everything to not show records that have uw.waction=2 CODESelect th.tid, th.tname, th.tmain, th.tcolor,coalesce(c.postnumber,0) as posts, uw.wuid, uw.wwid, uw.waction FROM thread AS th left JOIN ( SELECT ptid, sum(ptype=0) as postnumber FROM forumpost GROUP by ptid) as c on c.ptid = th.tid LEFT JOIN userwindow uw ON uw.wwid=th.tid AND uw.wuid=2 WHERE th.tmain=1
Auto_increment, Mediumint?
I've always used mediumint with auto_increment, is it ok to use anything else (like int) with auto_increment, or does it have to be mediumint?
Mediumint Values
I am just curious to know whether it is possible to write negative numbers to an integer field such as mediumint? I have always used these field types with positive integers so would writing, -100 actually cause a problem?
Quick Join
I have two tables Matches (m_id, m_winner_id, m_loser_id) and Users (u_id, u_name). m_winner and m_loser_id are foreign keys. Now I want the querry result to look like this: Match ID | Winner Name | Loser Name. I did a join query: Select matchs.id, users.name From matchs, users Where matchs.winner_id = users.id How do I get the loser name?
Quick Fix 4 MySQL Pro
I will have a few instances like this and since I'm new to MySQL, perhaps a good example will help down the road. All I want to do is display a list of the first and last name of the names in my DB so they appear like so: John Smith Suzie Johnson Etc... first and last are two separate fields in the DB so I just need to join them together. The code I have now gives me this error: PHP Notice: Undefined index: first in e:etc... <?php // Request the names in db $result = mysql_query("SELECT artist.first, artist.last FROM artist"); if (!$result) { echo("No artists posted at this time"); exit(); code...
Quick Join
I have a quick SQL question: I have two tables Matches (m_id, m_winner_id, m_loser_id) and Users (u_id, u_name). m_winner and m_loser_id are foreign keys. Now I want the querry result to look like this: Match ID | Winner Name | Loser Name. I did a join query: Select matchs.id, users.name From matchs, users Where matchs.winner_id = users.id How do I get the loser name?
Quick PhpMyAdmin
I believe I got phpMyAdmin setup to work right, I used HTTP authentication, and I get a log in screen when I goto the url. How do I set up an account for that? GRANT ALL PRIVILEGES ON acct1_db.* TO 'Brian'@localhost IDENTIFIED BY 'password'; Is that right? I wish to host websites off this computer and have multiple users. Do I need to log in to the controluser account to do it? Or am I way off?
Quick Query
this one shoud be easy, but I just can't think of the best way (other than writing a php script to do it). I have a CMS and need to change one word in the description field for 64 rows. For example, where we now have 64 entries with "Bilbo" in the middle of the data, we need to change it to say "Frodo" instead. (Actually, I need to replace a misspelled javascript toLowerCase() call...darned non-programmers! They used toLowercase() - note the lower case C)
Quick Queries
Is it possible to use a regular expression or similar in a mySQL query, to make 'fuzzy' comparisons, or is LIKE the best we can hope for?
QUICK AND EASY ONE
im fairly new to php/mysql so please bear with me I am trying to upload a txt.file created from an excel spreadsheet using the following query: LOAD DATA INFILE 'path/file.txt' INTO TABLE my_table; im getting a syntax error! what could be wrong? are there any other attributes i should be adding to this query? i also tried uploading a csv version of the same file and get the same error.
Quick COUNT()
The MySQL documentation says: COUNT(DISTINCT expr,[expr...]) Returns a count of the number of different non-NULL values. How do i get it to INCLUDE null values? I am using COUNT with the DISTINCT bit as well, and i want the NULL rows to count as one as well.
Quick Tip: Switching Field On/off
Ever wanted to change a database field (typically TINYINT(1)) from 1 to 0 or from 0 to 1 depending on the current value? No need for two queries. I just thought of this 'clever' way to take care of it. Never saw that done this way before, and should have thought earlier about this. UPDATE articles SET published = ABS(published - 1) WHERE id = x
How To Dump (quick) A Table Into Another One.
On MySQL, I've got a table I use as 'wild card'. I mean, I store data into it and, at the end, I dump all the date into 'production' table. Until now, I perform it following these steps: 1) I empty 'production' table 2) I make a SELECT of every rows of the 'wild card' table and an INSERT into 'production' table. 3) I empty 'wild card' table. But I've got problem: during SELECT+INSERT time, 'production' table is not full and there's a data lack.
How To Dump (quick) A Table Into Another One.
On MySQL, I've got a table I use as 'wild card'. I mean, I store data into it and, at the end, I dump all the date into 'production' table. Until now, I perform it following these steps: 1) I empty 'production' table 2) I make a SELECT of every rows of the 'wild card' table and an INSERT into 'production' table. 3) I empty 'wild card' table. But I've got problem: during SELECT+INSERT time, 'production' table is not full and there's a data lack.
Quick Ones To Speed Up Access
------=_NextPart_000_0032_01C35FC2.62884DE0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am querying from a table containing more than 40,000 records. Earlier = when the records were 10,000 it was taking 9 sec and now after 1 year = and 40,000 records its taking 30 sec. Code is the same.=20 I am pretty sure that it has something to do with database only. No body = can think of spending 30 secs for retrieving values from tables unless = it's very huge in the sense of millions of records. =20 I don know whether I have to modify my database or do some sort of = restructuring or reindexing so as to make it fast enough. Is there some methods or optmization which can be applied to this = database which hasn't been touched since design to enhance the spped.=20 If there are some quick ones but valued alottttttt please let me know.
Dump (quick) A Table Into Another One
On MySQL, I've got a table I use as 'wild card'. I mean, I store data into it and, at the end, I dump all the date into 'production' table. Until now, I perform it following these steps: 1) I empty 'production' table 2) I make a SELECT of every rows of the 'wild card' table and an INSERT into 'production' table. 3) I empty 'wild card' table. But I've got problem: during SELECT+INSERT time, 'production' table is not full and there's a data lack. I'm looking for a faster way. Does anybody know it? Thank you very much. PS: I was told about 'mysqldump', but I do not know if it's faster than mine.
Quick Date Subtraction Question
When I do the following, I get the number of days in difference between two dates however for the dates that have expired, I get the number of days back negated, ie -3 for example? What I actually want is that if there has been an expiration, I want the result for a given row to be 0. Anyone got an idea how to? // timestamp is datetime creation of record // expires is date in future, ie 7, 14, 21 or 28 days in that increments mysql> select day( expired ) - day( now() ) as days from polls; Here is an example of the data returned, +------+ | days | +------+ | 7 | | 7 | | -3 | | 7 | | 7 | | 21 | | 7 | | 7 | | 14 | | 21 | | 7 | | 21 | | 7 | | -3 | | 21 | | -3 | | 7 | | 7 | | 7 | | 14 | | -3 | +------+
Quick And Easy Update Query? Or Not Possible?
I need to do a global change to a column in my database. I know this is poor planning on my part, but I recently made a change to all of my image extensions for speed purposes. I have a column called thumbnail_path, and every value ends with .GIF. I would like to change them to all end in .JPG. How can I do this? Is this even possible to do in one update query? or will I need to select, parse w/ php and then update?
Quick & Easy MySQL Sync?
Does anyone know of any quick and easy way to sync a local development mysql server to a remote server and back. I'd like to be able to optionally sync either direction?
Quick Mysql Auto_increment Question
i noticed that after adding some test data into my table the autoincrement is working fine. but after i delete them, even though the table is empty again the new data i put in will have primary key thats in auto_increment as if the old data was there. for example i added in 2 rows. now i have an id 1 and id 2. i delete them and the table has no rows. but now i add another two rows after wards and they get assigned id 3 and id 4. is there anyway for me to make the counting start over??? thanks for any replies or thoughts on this.
Quick Question About Reseting Demo Database?
I would like to set up a cron job to reset my demo database on a regular basis. Is there a way to export an sql file via phpmyadmin, and run it as a whole via the PHP mysql commands? The only way I can see to do it, I have to split up the exported sql from phpmyadmin into individual queries. I'd like to just process the entire .sql file at once, as it would make maintenence much easier.
Multiple WHERE X='$x' In A Query. (Quick Answer Needed)
My query works when I only use one WHERE instance, but not with both, and i know I have data that matches both criteria. Is this the proper way to pull results that match 2 criteria? $query = "SELECT * FROM Cartridges WHERE TYPE='$TYPE_Query' & PRINTER='$PRINTER_Query' ORDER BY ID ASC";
Mediumint Of "0"
My question is concerning numeric datatypes. Since each mediumint takes up 3 bytes, I was curious to know, if Mediumint with the value of "0" or NULL, would still take up 3 bytes?
Quick "WHERE"
Part of a WHERE criteria I'm trying to construct needs to return only those records where a date field in my adkey table contains a date older than a user-specified date (submitted as variable {sRemoveDate} from a web-page form). The following works: CODEWHERE (adkey.D_RemoveDate < '{sRemoveDate}' Or adkey.D_RemoveDate is null)
|