Pull All Usernames
Say I want to pull all usernames beginning with the letter A. How can I do so?
View Complete Forum Thread with Replies
Related Forum Messages:
JOINs And UserNames...
i need a bit of help on the following problem. Table I Row_i. 1 2 _ Row_ii. 3 1 6 ... Row_j. 9 _ _ The numbers in each row identify users (User_A, User_B, User_C); not all rows have all three users filled in - in the example above, the first row has two users, the second three, and the last only one. Table II Row_i. 1 Fred Bloggs Row_ii. 2 John Smith Row_iii. 3 Pat Brown ... Row_j. 6 Tom Adams ... Row_k. 9 Vicky Brown ... Row_l. n Name Surname I can thus identify each user (if present) in Table I. So far, so good. Now for the problem. I need to generate a list of ALL the names used in Table I, either as User_A, User_B, or User_C, without repetitions, ordered by Surname. Given the example above, the output should be 6. Tom Adams 1. Fred Bloggs 3. Pat Brown 9. Vicky Brown 2. John Smith Simple, right?... But I guess the old brain is just not cooperating today, because I can't seem to get my query right. Any simple and elegant solutions out there? Many thaks in anticipation for your help.
View Replies !
Create Usernames And Paswords
I'm been trying to create users whit pasword and privilegeies. I learnd to use oracle database at shcool, but i has diferent syntaxes for creating users. Soo im not used to mysql. But i dot get any message from the mysql server if the user in fact has been created or not. I'v tried serveral different way to create a user. --user=test --pasword=testing databasename I also tried putting the users into a user table. but nothing works But when i try to log on one of the users through a java aplication i get acess denied from the database.
View Replies !
MySQL Databases And Usernames
Let's say I make a database called "bri" and then username "site1" Can I use the same database, but create a new username "site2" for a different site? Like, say I installed Wordpress on "site1" and vBulletin on "site2"... does that work? I've always just created a new database, but I've been wondering about this.
View Replies !
Mod_auth_mysql Or Mysql Usernames And Passwords
I'm writing a web app that needs a login page. I'm doing the dev on a windows box although the final version will go on a Linux box. I can't find any versions of mod_auth_Mysql precompiled for windows and have no idea about compiling c.source on windows (or anything to do it with). Is there a good reason I shouldn't store hashed password in MySQL and call them from Python scripts instead of using the apache auth module directly?
View Replies !
Find Last Logins And “JOIN“ Their Usernames
I want to be able to list the last logged in members. I have a “member“ table and a “login table“. The members have a unique ID (“id“, int; 11) in the “member“ table. This unique member ID is inserted to the table “login“, everytime the member is logging in to the site. In the “login“ table the field name for the members unique ID is “userid“(“userid“, int; 11). A new record is created/inserted for each and every login. I can't get my SQL statement to work =( I need to “group“ to only show one member, but the SQL statement isn't working =( I have tried this: SELECT * FROM login INNER JOIN member ON login.userid=member.id WHERE member.image != 'missing.gif' GROUP BY login.userid ORDER BY login.id DESC LIMIT 8;
View Replies !
Hide Mysql Usernames And Passwords
I'm trying to have people access a secure mysql database. If they get to a certain webpage, they have clearance to access the database, and we have one password and one username (that the users do not know). Does anyone know how to have it so the people cannot see the cgi script to access the database?
View Replies !
Changing Usernames On Lots Of Tables
I have a database intensive web site and we allow people to change their usernames. When someone changes their username, over 32 queries have to be made in order to change their username to the new one, because there's tons of tables. Everytime we add more tables that number only continues to grow. So we decided to use account id's (primary key) instead, replacing the usernames, and using JOINS to grab the username each time it's needed for display. Eventually, to change someones username, only one query would needed. Now TONS of CPU is being used due to all the joins. All indexes are in place and types are always const, ref, and/or eq_ref. What would be the best solution to this problem? Would subqueries be better?
View Replies !
How To Store Usernames With Special Characters
This may sound like a bit of a stupid question, but using MySQL (5.0), what is the best way to store a username that contains special characters (such as Spanish or Portuguese characters like ñ, ç, ã, é but not limited to these, any character really)? When taking a registration from someone, should I run the username through PHP's htmlentities first before inserting it into the database and then whenever querying it, run the query string htmlentities also? Also, MySQL seems to by default, store all characters as "latin1_swedish_ci". Is it advisable to store them as "utf8_unicode_ci"?
View Replies !
Changing Existing Mysql Account Usernames
The situation I have is, I have an existing MySQL user account, lets say its called "myacct". What I want to do is change "myacct" to "testacct", leaving all the account privileges intact. From looking at the database I thought I would be able to accomplish this by issuing UPDATE commands on mysql.db, mysql.tables_priv, and mysql.user to change all occurrences of "myacct" to "testacct" but this gives me some weird problems when I try to access the database using "testacct".
View Replies !
Pull All Records
if it were possible to write a statement in SQL where one could select several fields from a table and then limit the records returned by only displaying those where, say, FieldA (a varchar) contains a given short string which could be only a part of the field's contents. As long as a record has this short string in Field A, it should be included in the resulting set of records.Something like this: SELECT FieldA, FieldB, FieldC FROM TABLE Table1 WHERE FieldA *contains string* Is there anything in SQL that could examine the contents of a field for a partial string, and then return the records that have that partial string in that field?
View Replies !
Multiple DB Pull
Lets say there is a database of special users and a database of favorite movies SPECIAL USERS (username) bob jim FAVORITES (username - movie_title) bob - movie 1 kim - movie 3 jim - movie 1 larry - movie 2 jane - movie 2 How would I write a query that lists the most popular movies of special users without explicitly doing: SELECT * FROM FAVORITES WHERE username = 'bob' or username = 'jim' GROUP BY movie_title I want something like this: SELECT * FROM FAVORITES WHERE username = [all the usernames from the SPECIAL USERS DB] GROUP BY movie_title
View Replies !
Mysql Pull
I got this in my mysql databe table. a:1:{i:0;O:19:"test_Enclosure":4:{s:4:"link";s:36:"http://grabber/v/CAcpLiw4qt4.swf";s:4:"type";s:29:"application/x-shockwave-flash";s:6:"length";N;s:10:"javascript";s:2:"js";}} I want to pull out only the http://grabber/v/CAcpLiw4qt4.swf part?
View Replies !
Can Input Japanese, Can't Pull It Out
I figured out how to store Japanese characters by setting the collation of a particular field to utf8_bin. I can input Japanese characters, and I can see them just fine under PHPMyAdmin. The problem is that when I execute a query and print them to a web page, all I get is question marks instead of Japanese characters. This is while using the same browser that allows PHPmyAdmin to display the characters correctly. I added the following metadata to the <head> portion of the document but it didn't help: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
View Replies !
Populate A Pull Down Menu From Db
how do I populate a pull down menu from a MySQL table? Using PHP/MySQL 4.0 Have table1 with names and ID and tableb with ID and statistical info.wnt to be able to scroll names and have users able to click on the name to follow a link to a page created using tableb data for each name listed. Table examples: tablea ID l Name --------------------- 1 Person, Joe 2 Smith, Joe tableb ID l units l margin -------------------------------- 1 5023 123 2 2536 72
View Replies !
Code To Pull Amount
I'm certain there is a function to do this but I forget what it is... Say I am pulling values from the database, but I only want to pull like the first 10 chars of the value.. how do I do that?
View Replies !
Pull Hosting Plans
I am currently creating a web hosting website for a client of mine, for the packages and the order process we are using a script called "Auto-Host (http://www.idevspot.com/AutoHost.php)", which stores all the hosting plans into a mysql database. This is a great script and it does exactly what we want it too, the only thing missing is it doesnt create a page where people can view the hosting plans and click a sign-up button. Can someone please give me guidance on how i can get a page with all the hosting plans on please?, alternatively i am willing to pay somebody for doing this on my behalf
View Replies !
Pull The Last 10 Records From A Transactions From A Table
I'm trying to pull the last 10 records from a transactions from a table using this query: SELECT * FROM transactions ORDER BY timestamp DESC LIMIT 10 But I want to display the rows in ascending order by timestamp. I can't get the subquery below to work and not sure why: SELECT * FROM (SELECT * FROM transactions ORDER BY timestamp DESC LIMIT 10) ORDER BY timestamp ASC;
View Replies !
Pull Related Info Using Subqueries
I'm creating a tool to browse a database of movie listings. The browser pulls up 25 results at a time, and you can page through them using 'Next' and 'Prev' tools. Pretty basic stuff. Here are my tables: movies directors comments movies_directors movies_comments etc... (primary key is movies.id) But here's where I'm stuck: for each film, I need to pull the movie info in 'movies', plus any related data from other tables, like this: The Lord of the Rings | Peter Jackson | 3 comments Episode II | George Lucas | 0 comments Indiana Jones | Steven Spielberg | 15 comments I seem to run into problems when I try to join info from all of these related tables. If there's a match, great. But, if not (like a movie with no comments), the movie is excluded from the result set. I've tried all sorts of SQL queries to make this work, but nothing seems to do the trick. SO, HERE'S MY QUESTION, IS THERE ANY WAY TO DO THIS QUERY WITHOUT SUBQUERIES/MYSQL 4.0? Or would the best approach be to use PHP to do all the subquery lookups?
View Replies !
Pull Similar Data From Two Tables
I need a query to search two seperate tables for similar data and return them in one result. I know you can do multiple select statements in one query but I dont know how to exactly organize them into one result. Does anyone know how to accomplish this.
View Replies !
Result Pull And Rating Sort
I have two databases. What I would like to happen is when I have a summary of products, I would like the query to pull the info from the product table and based on the id from that table cross reference with the reviews for that particular product and calculates all the reviews for that product into a single percentage. So when I access the assoc array from PHP I would like to see : Array(Array(['id'] => '2', ['prod_name'] => 'gummy bears', ['rating'] => '72'), Array(['id'] => '57', ['prod_name'] => 'socks', ['rating'] => '52')).
View Replies !
How To Pull Data From Multiple Tables
I have a db, with several tables in it, I have now reached to the point where I need to pull data from several tables. What is the best way to do this? Should I put a column in each table, and then insert a unique key in all of them at the time the record(row) is being created? If this is the way to do it, when I am putting the unique key in each table would I just do an insert in each of the tables?
View Replies !
Pull Data From Multiple Tables
Can you pull data from 2 tables in the same database onto the same page? What about more than 2 tables? Here is my dilema: I currently have a database with 1 table, and a ton of rows. The information is property information, and each property has multiple empty suites. As of now, I have columns for Building Name, Address, and then columns for Unit Type A (for the first unit), Rent A, Type B, Rent B, etc.... I was wondering if I would be able to put the listings we have into thier own property table, and then one bigger table of all the properties individual information. Keep in mind I need to call all tables together on my portfolio pages, so I would be connecting to quite a few tables at once. Or my other option I was thinking about was to just have 2 tables: 1 Buildings info, and 1 units info. Which of these would you do, or how would you organize this data.
View Replies !
Regular Expression :: Pull 3 Or 4 Digit Numbers
I would like to pull all the model number from my products table that are strictly only a 3 or 4 digit number ie: 034 or 3542 or 0243 or 934 etc Can someone advise me on how to construct a regular expression to give me the data I need?I have tried the following but it wasnt 100% accurate: Code: products_model REGEXP "[[:<:]][0-9][0-9][0-9][0-9][[:>:]]" or products_model REGEXP "[[:<:]][0-9][0-9][0-9][[:>:]]"
View Replies !
Pull Info From One Database To Save In A Session To Push To A Different DB
I'm building a dynamic site that has 3 data bases. One DB contains all of my store info ID#, Name, Address, Phone. Another DB contains member info ID, Name, address, email,phone,etc... The 3rd DB Tracks when a user logs in and logs out at a store. This DB has the following columns Store ID, Member ID, log in time,log out time, time in store. The stores log in in the morning that starts a session-I need the session to pull the store's info ID#, Name,etc... so when a user logs in, in the store. The login page inserts the store ID, Store name, and user ID into the 3rd DB. There are a lot of stores how do I get the store variables to be inserted into the DB?
View Replies !
Pull Data From 2 Database Tables Into 1 Table On My Site.
I got 2 tables: a dev_tasks and a task_history table. The task table has to record information about the task I am working on AND the history table is for the task history logs. I am trying to display info from both tables into 1 table on my site. Most of the info will come from the dev_tasks table BUT i want to dedicate on column of the displayed info for the latest log made to the task_history table. The common column to both tables is the 'taskid' column. What would the query look like to pull the info from both tables, knowing that the taskid is common to both and that I want to display the last log per tasks from the task_history table?
View Replies !
Trying To Pull Id, Count And Title But Lose Rows When I Add Extra Join
i'm trying to extract some information from my database, the query being PHP SELECT grps_c.catid, grps_c.title, COUNT(grps.groupid) AS COUNT FROM grps RIGHT JOIN grps_category grps_c ON (grps_c.catid = grps.catid) GROUP BY grps_c.catid ORDER BY grps_c.title which works fine. however some of the groups (grps.groupid) are hidden and i don't want to count them, so my thinking was add PHP LEFT JOIN grps_setting grps_s ON (grps_s.groupid = grps.groupid AND grps_s.hidden_group != Ƈ') however adding that removes the rows that have a 'count' or NULL or Zero.
View Replies !
|