Sorting Columns. Setting Up Mysql ?
Interested in setting up information in columns to sort in ascending and descending order. I'm hoping to set up a clickable image for both options. I know basic html design, I'm just not sure where to start in mysql. Not sure how to set up the table and where to link them to php pages.
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
Sorting On Two Columns At Once
I have a table with 2 columns called "lastname" and "company" that I would like to sort. Sometimes the lastname column is null, and in that case I would like to use the company column for the sort. Is this possible? E.g. this data: [lastname, company] smith, amway jones, IBM <null>, microsoft should output the rows in this order: jones microsoft smith
View Replies !
View Related
Sorting By Two Columns?
Is it possible to ORDER BY one column ASC and then by another within the first order? You know like when you do a data sort in excel, you enter your first column and then your "then by" column and that second sort only takes place within the first? PS: I tried using the search function for this, but was unable to find anything.
View Replies !
View Related
Sorting Columns With ENUMs
Is there a way for me to sort the order of columns in a query based upon the ENUM values (in a 1 row query)? Example Table: col1 | col2 | col3 | col4 | col5 ----------------------------------------------- 1 3 2 4 1 and get back ( "col1 = 1, col5 = 1, col3 = 2, col2 = 3, col4 = 4") otherwise tell me no so I can start sorting it in perl instead.
View Replies !
View Related
Selecting And Sorting With Different Columns.
I am creating a small search engine for a site that reviews other sites. My DB structure is: TABLE `sites` ( `ID` int(11) NOT NULL auto_increment, `site_name` varchar(100) default '', `site_description` varchar(255) default '', `type1` varchar(100) default '', `type2` varchar(100) default '', `type3` varchar(100) default '', `type1_rating` int(4) default '0', `type2_rating` int(4) default '0', `type3_rating` int(4) default '0', PRIMARY KEY (`ID`), FULLTEXT KEY `forsearch` (`site_name`,`site_description`,`type1`,`type2`,`type3`) ) TYPE=MyISAM AUTO_INCREMENT=483 ; Assuming that I have 2 rows on my DB with the following data: SITE1 site_name='mysite' type1='car' type2='aircraft' type3='construction' type1_rating='23' type2_rating='40' type3_rating='34' SITE2 site_name='coolsite' type1='jet' type2='bus' type3='car' type1_rating='35' type2_rating='22' type3_rating='66' When I search for "car" it will find that the two sites match the query. That's fine. But how do I sort the results (based on the 'type_ratingX') if the value found is in different fields? On SITE1 I will use type1_rating and on SITE2 I will use type3_rating to sort!
View Replies !
View Related
Sorting PHP Content Into 3 Even HTML Columns
I am mysqlorarily without my Mysql database manager while he finishes his masters degree. I have a relatively simple problem. I draw data from my db into one column but need it to go to three, in order. The traditional html that I know does not work. Can someone take a moment please to provide a solution. Here is the code I have which works fine for the one column: .....
View Replies !
View Related
Memory ? When Sorting Multiple Columns
I am running MySQL Server 5.0.37 on a Windows 2003 Server. I have a table that I want sorted by three columns (column1, then column2, then column3). I can sort one column just fine. But, if the recordset is large, sorting by two (or more) columns crashes the MySQL Server Service. Through research it looks like I am having a memory problem as the following error message is written to the MySQL error log: Code: 080325 14:27:10 ERROR C:SWsoftPleskDatabasesMySQLinmysqld-nt.exe: Out of memory; restart server and try again (needed 32776 bytes) The my.ini file shows the following values: Code: sort_buffer_size=256K sort_buffer=256K Oddly enough, phpMyAdmin shows the following: Code: sort buffer size 32,776 I increased the sort_buffer_size and sort_buffer in my.ini to 512k,
View Replies !
View Related
Sorting Tables MySQL
i was making a web interface where a user could save their favourite pages on the site in a mysql database. The user logs in and has the favourites appear on the side menu. Well i got the login and appearing working and also adding favourites to the database. However, i'm kinda stumped on how i can allow the user to login in and organize their favourites. I am ultimately looking for something like the Internet Explorer Favourites Menu, where someone can add it and sort it. I'm probably thinking i can use javascriupt to have the user sort the favourites on the page but i don't know how to update that in the mySql table. I am not really looking for the code but a directions on how to get started and methods that i should explore.
View Replies !
View Related
Sorting/Grouping Result From MySql
I'm working on a PHP/MySql-site, and have run into a problem with presenting information from two tables at the same time. What I want to do is following: The site is used for writing diarys. There are many writers writing there, and I would like to present a list with the writers names and when they last updated their diary. I have two tables, one of them contains "uid" and "name", it's called diary_writers, and one with the diarynotes and "uid" and "date", it's called diary. From thesse tables I select the writers names and when they wrote in their diarys the last time with: "SELECT diary_writers.uid, diary_writers.name, diary.uid, diary.date FROM diary_writers, diary WHERE diary_writers.uid = diary.uid ORDER BY diary_writers.name, diary.date DESC" This produces a list with the writers in alphabetical order, and all dates they have written, with the last date in the top. So far so good. Here is my problem. I would like to have a list that only contains the last date each writer have written, not all dates they have written. I hav e tried to add: GROUP BY diary_writers.namebefore ORDER BY. This gives a list of the writers and the FIRST date they have written, not the last. I have tried to change the "datesorting" but without result.
View Replies !
View Related
Setting Up MySQL On Mac OS X
I'm a novice Unix user, and I can't get MySQL set up properly on my Mac. It seems to have installed OK, but when I try to run the mysql_install_ db script, I get errors. I can't set the root password either that the documentation tells me to. As background, I just want to use MySQL to work with databases and PHP and HTML to set up web pages for database input and output. I'm running MySQL on my own machine at home, and have no use for passwords or any other administrative functions. I'm just looking to use the program to set up and query databases. Can anyone point me to a way to avoid all the UNIX admin stuff and run the database? I can get in, but the mysql database doesn't appear when I hit SHOW DATABASES as the tutuorial says, and I can't access or create new databases. I think all this may have something to do with my user account on my machine, but I'm not savvy enough to know how to override permissions, be root, or any of that stuff. Any hints?
View Replies !
View Related
Setting Mysql
I'm setting up mysql server for the first time and after logging into the command prompt I setup a new super user and deleted the root user for security reasons. Now it seems I can't login to the server at all. MUST you have a root user to run a mysql server? If not, how can I login to do anything?
View Replies !
View Related
Sorting UTF8 Records With German Umlauts In MySQL 4
I have some records in a database that uses utf8 as character set and I am using MySQL 4.1. How do I sort results which are utf8 data with german umlauts? Using the SQL query SELECT memberid, lastname FROM member ORDER BY lastname does not sort the result after german umlauts. Any idea how I can sort the utf8 results containing german umlauts?
View Replies !
View Related
Re-setting Mysql As A Service
I installed mysql server 4.1 last month. When I installed it, I set it to run as a service to start automatically. However, for some reason, that no longer occurs. I can't even see the mysql service running from services viewer in win xp. I now have to manually start mysql server each time I reboot. Can someone please tell me how I can Re-set mysql to run as a service?? Or, if I re-install mysql, will it retain the db's already created??
View Replies !
View Related
Help With Setting Up A MYSQL Database
I’d like help with developing a mysql database please. The situation is as follows: There are 40 teachers at our institution. Each teacher teaches 4 lessons (I’ll call them: CW, EW, DSS and LNT) – CW and EW are taught to two classes, and DSS and LNT are taught to two different classes. There are 5 syllabus items for each lesson that need to be covered for each class. The course runs for 10 weeks. I’ve calculated the number of unique records will be 16000 The coverage of each week’s content depends largely on the level of the students, the teacher and/or any supplementary material used. On my php page, if a syllabus item is covered teachers need to check it as completed (checkbox). Any additions to the lesson need to be added to a comments field (textarea). Teachers should be able to log into to see their records (stored on the mysql database and accessed through php pages) and then be able to filter their records by week, class and lesson using drop down lists. The question I have is: What is the best way to set up the mysql database so that each record is unique so that I can accomplish the above? Fields: ID(int), content(text), teacher(text), course(text), week(int), completed(int) and comment(text) Running MySQL client version: 5.0.51b on Windows XP
View Replies !
View Related
Setting MySQL Host
I'm looking to grant access to a MySQL database based on a range of IPs. I did a search on the forums here and couldn't find exactly what I was looking for. The IP range is actually only 2 IP addresses but I'm sure there must be a way of setting the Host to accept something like: 123.123.123.*.Currently I can't test it as I don't have access to the web servers, but it someone could tell me the surefire way of doing this it will be one less worry for me .
View Replies !
View Related
Setting Up New Mysql Accounts
I have followed the manual for MySQL 5.0 for adding new accounts to MySQL but it will not work for me. I am typing these commands on the root on the actual computer with Every time I input these following commands, the command just returns this: mysql> Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON *.* TO 'myusername'@'localhost' -> IDENTIFIED BY 'mypass' WITH GRANT OPTION; mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP -> ON mydatabase.* -> TO 'myusername'@'localhost' -> IDENTIFIED BY 'mypassword'; I've also tried this one mysql> CREATE USER 'myusername'@'localhost' IDENTIFIED BY 'mypassword'; But it returns mysql> ERROR (HY000): Opteration CREATE USER failed for 'myusername'@'localhost' .
View Replies !
View Related
Setting Up MySQL Administrator
I just downloaded MySQL Administrator and am trying to install it. I'm trying "localhost" and "root" for Server Host and Username, along with the default setting for Port, 3306. However, I don't have a clue what a "Stored Connection" is. What am I supposed to enter there?
View Replies !
View Related
Configuring/Setting Up MySQL 5
Im a complete newbie to mac os x. I downloaded and installed mySQL 5. I installed it and now i cant seem to connect. I have absolutely no idea what im doing. Im not familiar with os x termial commands. I need someone to email me and explain to me everything i need to do in order to create a user and successfully login using mySQL admin. I've been struggling with this for over a week. Ready to pull my hair out. And please dont refer me to online resources, ive read them all and still cant figure it out. I need a professional who can give me a step by step process to get this going.
View Replies !
View Related
Setting Up The MySQL Password
I can't seem to see the page whan I am trying to set up the 'Setting Up the MySQL Password'. I know this is right at the start but all I get when I type in the Web browser http://127.0.0.1/myadmin is the sourcecode and not the actual log in page... I know it's something silly I have done or not done (I have installed the Apache / MySQL / PHP stuff over and over again, but it still does the same thing to me. The Apache services is running fine. The WinMySQLadmin is on green so I know that's fine. I think it's maybe an explorer thing? but I can't seem to get it.
View Replies !
View Related
Setting MYSQL Rules
i got table with one column of dates - time(). how i can set a rule inside the mysql -not on asp pages... the rule- take the maximum value and delete all the values that "smaller" than the maximum value, in 20 min
View Replies !
View Related
Setting Up MySQL On Mac > Leopard
PHP Code: $link = mysql_connect ("localhost" , "Cretaceous" , "Dinosauria") or die(mysql_error());mysql_select_db ("Trex", $link) or die(mysql_error()); and put it on a test page. When I preview it in a browser, it gives me the following error message: Code: Access denied for user 'Cretaceous'@'localhost' (using password: YES) I checked the privileges, as follows: User (Cretaceous), Host (%), Password (Yes), Global privileges (USAGE), Grant (No) It looks like my user name and password are OK. I changed the database name from Trex to trex (all lower case), but I get the same error message. Since the Privileges page lists the Host as %, rather than localhost, do I have to make some sort of change there? I replaced "localhost" with % in my database query but that doesn't work.
View Replies !
View Related
Setting Up MySQL Administrator (have WHM)
I would like to set up MySQL Administrator. (MySQL is taking up 50+ % of my CPU, and I'm not sure why...) I'm having difficulty connecting to my MySQL db. I'm fairly sure I have the correct username and password. For the host, I just used my server's IP and for the Port, I have 3306. When I try to connect, I receive the following error... MySQL Error Number 1130 Host '<IP address>' is not allowed to connect to this MySQL server. I tried adding <IP address> to the MySQL Access Hosts using WHM, but don't think it's working. In fact, I think when I initially tried it... my phpmyadmin stopped working and I had to go in manually to the config file and fix it up.
View Replies !
View Related
Setting MySQL Parameters Via PHPmyadmin
What is best selection for 'collation' parameter - for those, who need use two languages, latin(english) and cyrillic(russian) on website and need that mySQL handled and stored both languages correctly? What need be specified in "MySQL connection collation" field?
View Replies !
View Related
MySQL Performance - Option Setting
I set OPTION=3 in my connection string as recommended by MySQL (http://dev.mysql.com/doc/refman/5.0...parameters.html) for a VB application. OPTION=3 is Don't Optimised Column Width (1) and Return Matching Rows (2). I found this to be very slow on a database with just 27,000 records. It took approx. 12 seconds to read 27,000 records. When I change the OPTION to 8 (Allow Big Results), it took just 3 seconds to read 27,000 records. BUT now my application cannot update records anymore and getting random errors on transactions. I try setting OPTION=11 (all 3 options added together) and the speed went back to being slow.
View Replies !
View Related
Setting Up Mysql Tables For UNICODE
I am willing to setup my MySQL tables so they can hold international strings (English, French, German and Spanish). I understand that Unicode character coding is a good candidate to do so. Currently I use the default character set and it looks like it does not like characters such as "é", "ô" .etc... (they come up as strange characters probably indicating that the code of the character has been truncated). Is my understanding correct? If yes, could anyone lead me through on how to create such tables coding text as Unicode? I went through the MySQL administration guide but cannot get a clear understanding on how this is supposed to be performed. Ideally I would like to setup the MySQL *server* for it to process the tables with the Unicode character set *by default * (rather than specifying each tables one by one as using Unicode encoding).
View Replies !
View Related
Setting Up Initial Accounts In MySQL
I'm a newbie to MySQL. In setting up my initial accounts, I see two anonymous users in the mysql database in the user table. My book says to delete them which I did, but I still see what looks like two root accounts. Is this normal? If not, which one do I delete? I see one doesn't yet have a password; should I delete the one without a password? First I'll log out and log back in as root to see if that other root user is a phantom or is really an account. Next, I'll need to add a few users, but I need to make sure this root thing is correct. Here's a screen shot of wht I did: mysql> use mysql Database changed mysql> select user.user from user; +------+ | user | +------+ | | | root | | | | root | +------+ 4 rows in set (0.02 sec) mysql> delete from user where user=''; Query OK, 2 rows affected (0.01 sec) mysql> select user.user from user; +------+ | user | +------+ | root | | root | +------+ 2 rows in set (0.00 sec)
View Replies !
View Related
Setting Password For MySQL From WAMP?
A few months back I installed WAMP (one big installation of Apache, MySQL and PHP for Windows). The last week I'm busy with Portal development. As a result I'm trying to install Jetspeed-2. The installer of Jetspeed asked what Database I would like to use. As I installed WAMP I thought it wiser to stick to MySQL. When I started phpMyAdmin I saw the following message: "Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account." As it is some time since I installed WAMP I cannot remember what I need to do. I searched the install directory and found that the word password is contained in several .ini files (my-huge.ini, my-innodb-heavy-4G.ini, my-large.ini, my-medium.inim and my-small.ini, but not in my.ini). The format of the line is: #password= your_password I take it I need to remove the # at the start of the line, replace 'your_password' with a password of my choosing? But in what ini file? How does WAMP know what ini file to choose? In the same directory as the ini files I see a wampserver.conf file. In it there is an entry: $mysqlConf['mysqlConfFile'] = 'my.ini'; Does this entry make WAMP to choose for my.ini? I plan to use the WAMP/MySQL installation purely for development purposes.
View Replies !
View Related
Setting Up A MySQL Server With SBC Webhosting
So I got into my Database Tools section and all I have is this: * Documentation * File Importer * Monitor Table maintenance and testing * Schema Viewer View table definitions * Database Dumper Export table contents and definitions Special Notes: * Access to your MySQL Database will require that you supply your userid and password. * Download myodbc, a Windows 95/NT ODBC Client, from the MySQL Homepage. * For ODBC access use port 3306. There is NOTHING that tells me WHERE to access my MySQL Database, and myODBC does nothing for me because I don't know where my Database is (I've tried using it to in various ways and can't get anywhere). I have no idea what to do with that port number. Could someone help me out?
View Replies !
View Related
MySQL Setting Collation To Latin1_swedish_ci
No matter how I configure MySQL 4.1.9, I always end up with all of my tables having collation set to "latin1_swedish_ci". I have tried setting the collation to "latin1_general_ci" but my settings are ignored and all tables show up as "latin1_swedish_ci". The tables that were created have been created and all data inserted through a PHPMyAdmin SQL file export under a server running MySQL 4.0.22. Is there any way to fix this and what is might be causing it.
View Replies !
View Related
Setting UP MySQL To Work With Dreamweaver And PHP
I'm trying to set up Dreamweaver to work with PHP and MySQL but cannot get Dreamweaver to recognize my database. I currently have PHP running under Microsoft IIS on my Windows machine and MySQL installed and running. I'm accessing it through MySQL Administrator and also MySQL-Front and don't have any problems connecting to the database in either of these programs. I've set up a DSN for the database, under ODBC Data Sources, and I'm using a virtual directory under IIS for the web pages I'm developing. When setting up a database connection though in Dreamweaver, I get an error message that says "An unidentified error has occurred" As far as I can tell, I have MySQL set up for Root access and also anonymous access. Any suggestions about what I'm missing to get this to work?
View Replies !
View Related
Setting Root Password For MySQL
I'm Using the "Build Your Own Database Driven Website Using PHP and MYSQL" by Kevin Yank. On pg. 22 where the arguments new password are in parentheses, I typed in new password instead of my own new password ( I know that was dumb!). Anyway, when I quit the Mysql and start over I get the error: cannot login to local host password not excepted. How do I restart so that I can create a root password for Mysql?
View Replies !
View Related
Setting MySql Root Password
I feel a bit daft as I can't seem to get passed p21 of Database Driven Website by Kevin Yank. But I'm learning Ive got the latest copy and and want to follow it through to see what i can learn (lots I'm sure) Im on a mac osx and am trying to set the root password. He says to do this using terminal in the bin directory of my MySql installation. Where is it? i know basics about getting round terminal i.e changing directories and stuff.
View Replies !
View Related
ERROR When Setting Password Via Console (MySQL V 5.1.30
I am trying to set a password via the console with the following: mysql> update user set pasword - password<'password'> where user = 'root'; and receive the error message: ERROR 1064 <42000>: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where user = 'root'' at line 1
View Replies !
View Related
Logical OR On Columns? (Merging Two Or More Columns Into One Column)
Considering the following example table: Column1 | Column2 | Column3 =========================== NULL |"Value1" | NULL --------------------------- "Value2"| NULL | NULL --------------------------- NULL | NULL |"Value3" In each row only one column contains an actual value (a string in our example), the other columns are set to NULL. I would like to merge those columns into one single column, discarding the NULL entries. The desired result would look like this: Merged_Column ============= "Value1" ------------- "Value2" ------------- "Value3" A '"SELECT column1 OR column2 OR column3 as "Merged_Column"' doesn't work unfortunately. Is there an easy way to accomplish this on the SQL Server? The next problem I am going to face is that every column is in fact made of a different data type (ie. Date, Int). Is there a way to modify the merge select (if that's possible) to have it cast everything into a single specific type? Ie. make everything in the merged column a string.
View Replies !
View Related
How Do I SELECT FROM Columns Where The COLUMNS Has A PATTERN?
I've been looking far and wide on this one. I'm looking for a way to select from columns where the columns have a certain pattern! Example: Instead of doing: SELECT q1, q2, q3, q4, q5, q6, q7, q8, q9 FROM exam I would like to do: SELECT q* FROM exam or SELECT q% FROM exam Whatever will match everything that has the letter q in it. Anyone have an idea? I've been banging my head on this one.
View Replies !
View Related
PHP/MySQL Sorting By Date & Time (using Non Military Time)
This is probably a simple issue but I have searched online and can't find an answer. I am using PHP/MySQL and I guess the most intuitive would be to have three select boxes containing HOUR / MINUTE / AM,PM option. Then store the time into mysql using there functions so I can output the data sorting them all by date and time. All the examples I have seen are for military time only but I'm sure there has got to be a simple mysql function or php function that converts non military to military and a formatting function to display with the AM / PM. But I have not found it.
View Replies !
View Related
Order Of Mysql Columns
Is it possible to alter the order that mysql columns are held within the database? I have some large tables with columns that I have recently added. I'd like these to be grouped with similar data.
View Replies !
View Related
Mysql Table Columns
Can someone please help me out. I am trying to export specific columns in a mysql table to a text file. I am using this command to export the table: SELECT * INTO OUTFILE 'useraccounts.txt' fields terminated by '|' FROM UserAccounts But I would like to only retrieve certain columns of data from the UserAccounts table.
View Replies !
View Related
|