Query For Member Information And Photo
member
member_photo
The member_photo has a record for each photo they upload. They can then choose which photo is their primary photo, which is flagged with a field called photomain. Im trying to get the list of all members along with their primary photo but Im using 2 queries which I feel is slowing down the page. Is there a subquery I should be using?
PHP
$query1 = $db->Execute("SELECT id,firstname,lastname FROM members ORDER BY lastname ASC"); //loop through the recordswhile(!query1->EOF){$memberid = $query1->fields['id'];$firstname = $query1->fields['firstname'];$lastname = $query1->fields['lastnamename'];$query2 = $db->Execute("SELECT photothumb FROM member_photo WHERE memberid = $memberid AND photomain = 1 LIMIT 1"); $memberphoto = $query2->fields['photothumb']; $query1->MoveNext();
View Complete Forum Thread with Replies
Related Forum Messages:
Only Display One Photo Instead Of All Photo Upload By User... How?
I have a tableA storing user id and password, another tableB storing user id and the image file name. User can upload 5 photo to the site. Now, I wish to display a photo in the search result (when people search for user with name starts with 'A') I have no idea how to only display one photo for the searched user in the result. Do you know any solution?
View Replies !
Information About Hacking Query
Yesterday i found some hacking attempt on my machine. ( I found some unknown queries on binary log) But i don't get any information about hacking query connection on binary log file.. ( username, host.. i don't know anything ) only thing that i know is "thread_id". ------ How can i know other information about connection. is there any option??? ------ one more.. hacking connection's thread_id has sequence with web connection:
View Replies !
Hosting Photo Album
I am writing a database for an online photo album website which will allow people to sign in, upload photos, and have an online photo album. I am trying to figure out the best design for this type of application, and I am not sure how to best set up each persons picture database. I suppose there can be a table with a list of all of the people, and then a table with all of their information that is linked to the list of people..does that sound right? Also, does a primary key need to be the same for each table that is related to each other? (Silly question, I know.)
View Replies !
Can You Retrieve Information From Describe Table Query?
I was wondering if it is possible to extract the information from describe table to an application. So that a user may choose with which fields of a given table he wants to perform a search. More specifically is there a query that will return me for example the fields for that table and their respective types, that may be forwarded to something like PHP, and print them to the user?
View Replies !
How To Delete The Uploaded File(photo)
i have made a e-pal section where the members can upload the photos....now i m making a edit portion for the e-pals where the e-pals can edit their profile n change their photos......i have used mysql to store the datas of e-pals n the path of uploaded images(note it:mysql stores not the images only the path)...
View Replies !
Suggestions On DB Setup For A Photo Album
At the moment the site is just used by me, in time I might open it up to friends to use too. So I want to develop a DB that works now and doesn't need to be modified for the future upgrade if it happens. I'd like to have it so when when you go to the photo sections it shows the albums, represented by a single picture from that album. When you click that picture it goes to a new page that shows the pictures for the album. Should I make two tables, albums and images or just one images and have a way to find out which ones are the main image for albums and which pics belong to them?
View Replies !
Member Searches
I had to code a member search page for a website that needed to join 2 different tables with 3 million rows in each for work just recently and it is painfully slow... but that's not my question. I'm now building another site that I'm starting from scratch and don't want to run into the same problem somewhere down the road. Is it not a proper line of thinking to make a "search" table so everything is in one place even though it would be duplicating information that's in other tables already? That way I wouldn't have to join 2 large tables again if it ever came to that.
View Replies !
Create A Member Login
I have MySQL installed on my domain and would like to create a way for users to register and have their details added to the database and then to be able to login using that username password.
View Replies !
Member Registration ID Increment
I am trying to setup a seperate member registration form for IPB 1.3. Unfortunately, IPB's table structure of mysql doesn't increment the member ID automatically. So, in their registration form, they increment it manually. This is what they have: Code:
View Replies !
Call To A Member Function On A Non Object
Below is my complete code (less the connection to the database) When I run the following code, I get the following error: Call to a member function fetch() on a non-object in line 138 If I comment out the PROBLEM LINES, the shopping cart partially displays onscreen, but the content of shopping cart passed from the previous .php screen is not passed in completion. What I need are the mysql commands or something to replace PROBLEM LINES that will access the information passed from the previous shopping cart page. // Select the Database $db_select=mysql_select_db($db_name); if (!$db_select) { die ("Couldn't select the database: <br/>". mysql_eror()); } // Process actions $cart = $_SESSION['cart']; $action = $_GET['action']; switch ($action) { case 'add': if ($cart) { $cart .= ','.$_GET['id']; } else { $cart = $_GET['id']; } break; case 'delete': if ($cart) { $items = explode(',',$cart); $newcart = ''; foreach ($items as $item) { if ($_GET['id'] != $item) { if ($newcart != '') { $newcart .= ','.$item; } else { $newcart = $item; } } } $cart = $newcart;.....
View Replies !
Importing Member Database Via PHPMyAdmin
I have a member database which contains usernames, password, names, contact info, etc. I have been able to successfully import it into MySQL via PHPMyAdmin, my question is how do I turn the passwords column into a MD5 value for each of the 5215 rows? The passwords in the spreadsheet are their raw values. I need them to be MD5 values. Is there something that I can do in PHPMyAdmin to edit the passwords column to turn them into MD5 values or is there something that I should do with the spreadsheet before importing it?
View Replies !
Highest Point Group That A Member Makes
data in myTable33 (id) continent country point member (1) Asia Asia 10 Tom (2) North America North America 5 Tom (3) 1 China 0 Mary (4) Europe Europe 15 Jane (5) 4 Germany 5 Tom (6) 2 Canada 10 Jane (7) 4 France 0 Jane (8) 2 America 5 Tom (9) 1 Korea 15 Mary (10) 4 Spain 5 Bill (11) Africa Africa 5 Jane I have data like the above in myTable3 Quote: The sum of Asia group is 25, ie. Asia(10) + China(0) + Korea(15). The sum of North America group is 20, ie. North America(5) + Canada(10) + America(5). The sum of Eeurope group is 25, ie. Europe(15) + Germany(5) + France(0) + Spain(5). Quote: The highst point maker in Asia group is Mary, ie. China(0) + Korea(15). The highst point maker in North America group is Tom, ie. North America(5) + America(5). //Although The sum of Tom's point and the sum of Jane's point are same in North America group, I like to choose Tom because Tom's record(id=2) comes first than Jane's record(id=6) The highst point maker in Europe group is Jane, ie. Europe(15) + France(0). Now I like to tell what I want. If any member's name is given, I like to retrieve the highest point continent group ID which the given member's records belongs to. The following would-be code doesn't work correctly, but I hope it will show what I want. code select ID from myTable33 where point=Highest Point continent Group #variables.theNameOfMember# has target result when the variable is Tom (2) North America target result when the variable is Mary (1) Asia target result when the variables is Jane (4) Africa // Jane has the highest point in Africa group and Europe Africa(id=11) comes latest than Europe(id=4) target result when the variables is Bill none Can I get my target result with your help in mySQL 4.0?
View Replies !
Fatal Error: Call To A Member Function On A Non-object
I am wondering why I am getting the following error: Fatal error: Call to a member function on a non-object in /home/blu6592/public_html/new/register2.php on line 46. Here is the code that is on line 46: PHP Code: $name_check = $db_object->query("SELECT username FROM comments WHERE username = '".$_POST['username']."'");
View Replies !
Site User To A Paid Member? Database Design HELP
I am currently working on a website where there are 2 types of users. The regular site user and a paid member. I am trying to figure out the best way to design the database (mysql) without redundancy issues. The site user can eventually become a paid member but a member does not necessarily have to be a regular site user (in terms of category). Information stored on a site user - first name, last name, address etc. The userID being the primary key. The member pretty much the same thing but new info will be memberID, join date, expiry date, status (pending, active, expired). I thought the easiest way to do this was to have separate tables. Do you think the best way? My thoughts are: When the regular site user becomes a member then store the userID in the members table. The issue I am faced with is how to store the other pieces of information. The address is not mandatory for the site user but is mandatory for the member. So, if the site user has an address then store it in the member table? that's redundancy there. Then a member do not necessarily have to be a site user in the sense of storing the info in that table. Design issues to think about - activation of membership once a confirmed payment has been received - Client is using Paypal. -What if the user clicks on membership and the user is also a site user? -What if the user is logged in as a site user and clicks membership? I would greatly appreciate your design recommendations.
View Replies !
Member Admin Rights To Tables (was "I Think I Need You SQL Gurus Help Once Again")
Here is a situation. I have a table of members. I have few other tables for different type of contents. Now I need to give administrative rights to few of those members for few of the tables ... overlapping will be there. Conceptually, it's like moderators of a forum, a moderator moderates one or a few forums, and one forum gets moderated by one or few members (who are having moderator status). Wondering, how should I go for the database logic here, I mean, what would be the best way to do the right management.
View Replies !
Replace Information In One Table With Information From Another Table
I've got two tables in one DB they have various columns; what I need to know is how I can take the information from a column in one table and put it in to a column in another table. table1 - characters table2 - characters_jackedup I want to take the information from column maxMp in table1 and put the information in table2 under maxMp the column exists in both; but the columns are in a different order.
View Replies !
Mysql Information
My company is currently investigating in several database, projects tracking software. Being a beginner, I would like to know if you could provide me some support concerning the capabilities of MYSQL. We are looking in a software that could achieve the following: - Enter text related to specific subjects (text can be pretty long and should be searchable by key words) - linking tables and extract specific information from those tables (no problem with that). - The ability to assign author privileges and to change them easily) - The ability to assign task to some users. - the ability to access the database and modify the information on the web. - the ability to automatically send the information by email or at least notify one of the user that a project has been updated. - the ability to point at other document (word, pdf etc) and to easily access those documents from the database.
View Replies !
Select Information
my current sql query is SELECT * FROM entries WHERE approved='1' ORDER BY rating DESC,hits DESC,votes DESC which works. but i want to implement multiple pages to my site. so i only want it to return for instance the first 15 rows, or only row 16-30 or only 31-45 etc
View Replies !
Entering Information
I have looked threw many books and the nety but cant find how I would enter more attributes into a table that already exists in a database in MySql All I seem to find is for to insert values into a table.
View Replies !
Group Information
I have a database with a date field in it, and I am trying to figure out how I can pull information for a calendar week at a time.I am sure that some type of loop is needed, but I am stuck trying to figure out the logic.
View Replies !
Most Common Information In DB
I have a database with the following fields id, system, reviewer an example would be 0, 5, 9 1, 5, 9 2, 4, 9 is there a way that i can search for all of reviewer 9's reviews, and find out what system is reviewed the most...?? so reviewer 9, it would be system 5 according to the example above.
View Replies !
Selecting Information
I need to select fields from one column, but this column contains duplicates on many rows. How do I write a query that only selects the info once and ignore it if it exists again.Pretty much I want to build an optionbox with every field from this column that is different. Since some fields in this column have the same value I don't want to list it twice so the standard SELECT all will not work.
View Replies !
Sortting Information
Here is a makeshift page I have made for sorting information regarding some car's and their respective times in drag racing. http://www.1320video.com/times.php As you may notice, when sorting some columns in a ASC to DESC fashion, it places the zero's before everything else. Without actually not selecting the rows with 0's in the SQL statement, is there a way to sort these so they show at the end?
View Replies !
Selecting Old Information
hello, i have a table called messages and i have a column in which the date of the message was created called dateSet, how can i select all of the messages that are older than 6months?
View Replies !
Retrieving Information As It Is
I have a mulitline input field, going to a database, when i view the inputted information in the database "browse" i looks exactly like it does when i typed it in for example Line one Line Two When i get the information back out using a SQL statement it come out in one lone line thus Line one Line two, with two boxes in between where the line break should be. I need to to come out as it went in Is this possible?
View Replies !
Get Information About An Error
I'm running MySQL 5.0.48 and would like to be able to retrieve an error number or error message when an error has occurred. I know that I can do: SELECT @@ERROR_COUNT; But since I mostly know that an error has occurred that is of little use to me. When connected to MySQL I can do things like: SHOW ERRORS; SHOW WARNINGS; But I can not do a SELECT so that is not of much use either. The reason I want to do this is to log errors that occur in a Stored Procedure.
View Replies !
Find Row With Most Information
Is it possbile to find select the row of a table, which holds the most information, via a SQL query ? E.g. there are 3 rows, in 2 of them are only 3 fields filled with data, the 3rd row contains data in all x rows, so this row holds the most information. Is it possible to do that generic, so without checking each specific column in the query?
View Replies !
Transfering Information Between 2 Different DBs
i have an old DB done for a forum in the mambo system ( now called joomla ), but i am changing now to vbulletin system + vbadvanced. The DB i use is MySQL in both forums, but when i open the backup file from mambo and compare it to the vbulleting DB using my phpdev system, i see that they are tottally different. would you have any tip for me so i can save at least my users and their information from mambo to vbulletin? Can someone help me? It´s a very seriou forum, it´s from Alias ( 3D Maya Software productor), and so, could please somebody give me a tip? A help? A force to make me win my MySQL battle?
View Replies !
Fetching Information
an example: $dbl->query($query); $res = $dbl->get_result(); how do i pull information from a row in $res without automatically moving the pointer ahead.with: $myrow = $res->fetch_array() i pull the correct information but i don't want the pointer to move ahead in $res.
View Replies !
Sql Headers Information
I have a scSi disk 36.4GB, I lost information from it and tried to recover with other recovery softwares to no avail finally I got winhex & got the professional licence. I can now be able to see all the information on the 1 whole NTFS partition, but the problem is that I can't be able to recover it. whenever I open the logical drive I can see all the information and most of the information is stack up in a "free space" which is around 33gb which I can be able to see has all the information that I need. I have tried to recover the free space but its only copied to the location that I specify and no recoveries are made. recovering the files by type/ name has bore no fruits. A freind told me I have to curve out that area and use data extractors to get the information out of that area (freee space). The information in that drive are sql data bases and zip files. whats the header for sql. what techniques do I use to curve out that space and be abele to extract the information, for I can even read the information in text format. which are the data extractors available in the market.
View Replies !
Passing Information
I'm having trouble passing an item from a text box to another screen. Whenever I enter an address into the box like 123 First St. the only thing that gets passed is the 123 on the URL. Because of the %20 spaces it cuts it off. How do I remedy that?
View Replies !
Displaying Information
I have inserted all of my information into my data base. Now I want to print it onto my website. I know how to get it to print onto my website, but I don't know how to organize it. I want to print the information into an table, and I want the table rows to alternate colors. Also I want to adjust font, how would I do this?
View Replies !
Information From Existing Db
Dont know much about mySQL, so excuse my potential ignorance here : Is it possible for a table to write information to another table automatically? For example, if on "table1" I have a column called "code", can I write the entire contents of a specified row to another table called "abc" if the code "abc" appears in the "code" column of "table1"
View Replies !
Change ALL Information In A Column
In a mySQL table, I have a column labeled "accept". The choice for the column is either: accept or waiting. When visitors add information, the default is "waiting" Is it possible to write a query so that I can change ALL the "waiting" entries to "accept" at one time?
View Replies !
Reading Information From 2 Tables
Code: SELECT * FROM stockcurrent s; ....it gives me back the stock count and the product ID but not the name (that is stored in another column). So then I try this... Code: SELECT NAME,UNITS FROM products, stockcurrent;
View Replies !
Retrieve Column Information
Couldn't find info on this topic, so will pose this question here...maybe it should be in the vbscript area? I would like to retrieve column information for a mysql table, from within a vbscript. The idea is to use this information to validate and format data before atmysqlting to insert that data into the table. For example, if the column 'desc' is formatted as 50 characters in length, and the data we are going to insert is 60 characters in length, the script could use the length info to trim down the data to the acceptable length. This would prevent insert errors from occurring. The same for other field types.
View Replies !
Retrieving The Information That You Used UPDATE On
I am using a command similar to this in a PHP script: UPDATE `tablename` SET replies=replies+1 WHERE id=12 Is there a way to get the result of 'replies' without having to create a new SELECT statement (which is what I am doing now), keeping all in one nice command?
View Replies !
Unique Information From Two Tables
creating a "latest posts" block for my forum. I need to get info from the topics and replies table but only have unique entries. How would i go about it, since the replies and topics table have different structures and names inside them for fields it's a bit tricky
View Replies !
PhPInfo MySql Information
I've installed apache , PHP and MySQL in phpinfo page information about is MySQL is not present. MySQL is working properly in DOS mode. any solution to display proper information about mysql in phpinfo.
View Replies !
Placing Information In Two Databases
How can I get data that always goes into one db column also write to a second db. Is it possible that what ever is written to one column to also be written to another column in another db? Shared or parsed somehow.
View Replies !
Changing The Information Location
I'm running mysql version 4.1.21 locally for my Java program to connect to. I would like to alter my system in such a way that the service could still be running on my actual local machine ... but the actual information will be stored on a mapped drive somewhere else.
View Replies !
Retrieving Information From MySQL
I have created a an online shop and it works fine on localhost and on the test server, however we want to intregate it with an online bank and its not working properly. When purchasing a single product the product can be purchased successfully however multiple products cannot purchased successfully. For some reason the page on the online banks server cannot access one our database that stores the information in the customers shopping cart but it can retrieve the information for a single product order. Im not sure if its some kind of issue on there server?
View Replies !
Deleting Information On Tables
I know this is a basic question, and I should be able to figure it out, BUT I have run out of ideas on this. have a table Person with the following columns: ssn firstname lastname zip_code And i have the table Zip with the following: zip_code city state I want to be able to delete an entire record both off of Person and Zip using the ssn. i've tried the following: delete from Person where ssn="111-11-1111" AND Zip.zip_code=Person.zip_code; Any suggesstions?
View Replies !
User Information Changed
The other day someone changed every user's password on my site. Then they changed every user's email address to theirs - I assume the reason was that when the user used the password reset function, they would never see the information. I'm trying to research what/where the vulnerability is in the script that I'm suing, but I don't really know where to start - not being a hacker, I don't even know the terms to search for here or on google. Is this what is meant by mysql injection?
View Replies !
|