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 Complete Forum Thread with Replies
Related Forum Messages:
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 !
Storing Values Of Session Variables Into MySQL Database
I'm creating an online survey with about 100 questions. To make it more user-friendly, I have broken them down to "bite-size" pieces of 10 questions per page. On clicking the "next page" button, the responses get stored in session variables. At the end of the questionnaire, when they click the submit button, I'd like the session variables to be stored in the database and the session will be destroyed. Code:
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 !
Session And Session History -
looking for a way to monitor connections that are currently open and their history. for example - join connection information (from where it is running, which program, etc...) with its queries history. In oracle you can find all the session information in the Data dictionary and you can easily join 2 tables to get it. I'm using MySql version 5.1.24-rc-community.
View Replies !
Form Submission Info To Go Into A Database
I am a web designer, but have minimal training in database. I have several clients who have submission forms on their sites. I would not only like to have an email going to them with the submitted info, but be able to capture the info into a database at the same time. My webspaces are "mysql" ready. Can anyone give me step by step to create the above or tell me where I might go to obtain the information?
View Replies !
Upload Mp3 File And Info Into Database
I decided to create a directory on my server to store the mp3 files instead and then to store the files path in the mysql so I would first create the table like this $sql = CREATE TABLE mp3_files ( id int NOT NULL AUTO_INCREMENT Primary Key, Song Name VARCHAR, Artist Artist VARCHAR , Release_Date date, Additional Notes VARCHAR, Path ?? ); where "Path" would it me VARCHAR type?? and how would I store the absolute path of the file using PHP Lets say I had a folder called MP3_Files on my server that would contain all my mp3 files and I uploaded an mp3 song called big poppa? How would I store this location so that when
View Replies !
Push
Does MySQL announce in any way when data has been changed in a database? That is, if I update a table with new information, does MySQL push an announcment? If not, is it in any way possible to make that happen?
View Replies !
Push/Pop For MySQL?
I was wondering if MySQL has a push/pop function? I'm creating a table for news items, with three rows - one for the date, one for the title, and one for the URL. What I want to do is limit the number of news items held in the table to 10. For example, if there are 10 entries in the table already (date/title/url sets) and I add another item, I want to put it at the top of the table and pop the bottom value off the table. I know I can do this by exporting the table to an array in PHP, then messing with it there and writing it back to the table, but this would take a lot of MySQL queries I think. Is there an easy solution to this problem I'm not seeing?
View Replies !
Push/pop Function For MySQL
if MySQL has a push/pop function? I'm creating a table for news items, with three rows - one for the date, one for the title, and one for the URL. What I want to do is limit the number of news items held in the table to 10. For example, if there are 10 entries in the table already (date/title/url sets) and I add another item, I want to put it at the top of the table and pop the bottom value off the table. I know I can do this by exporting the table to an array in PHP, then messing with it there and writing it back to the table, but this would take a lot of MySQL queries I think. Is there an easy solution to this problem I'm not seeing?
View Replies !
Receiving Sms Messages By HTTP Push
I need to receive sms messages from my isp into a php database & am a real php newby, so apologies in advance if this has been covered. I did look through the forum! According to the docs, "The HTTP push API allows incoming SMSs, including replies to outgoing SMSs, to be routed back to you via HTTP. HTTP GET is used, and all data are sent as simple query parameters." Is it as simple as writing a get statement, in say, "http://www.mydomain.dom/incoming/deliver.php?pass=blahblah" and having that insert the parameters sent into the database? Then upload the deliver.php file to my server and leave that to be called by the isp when sms messages arrive?
View Replies !
Query Using Session Name?
How can I make a query which searces using the name of the session currently open. i.e $query = "SELECT * FROM users WHERE username = '$_SESSION[name]'"; thats the idea but it doesn't work?
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 !
Session Vs. Global Variables
I have a question regarding setting my session variable. I want to set the wait_timeout value to 600 for both global and session variables. I put this in my my.cnf file: wait_timeout = 600 bounced mysql and then logged back into a new session. The 600 value is set for global wait_timeout: mysql> show GLOBAL VARIABLES LIKE 'wait%'; +---------------+----------+ | Variable_name | Value | +---------------+----------+ | wait_timeout | 600 | +---------------+----------+ BUT the session variable is still set to : mysql> show VARIABLES LIKE 'wait%'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | wait_timeout | 28800 | +---------------+-------+ How can i get the session variable to take the global value as the default??? I don't want to have to issue the 'set session variable' command in each session.
View Replies !
Session Timeout Issue
I'm trying to import several million records into MySQL but the darn thing keeps going to timeout before all of the records are imported. How do I change this setting? I'm using the command line and am very confused.
View Replies !
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.
View Replies !
Open Session From Client
I have Mysql running fine on a Linux box. From host I can run mysql and mysqladmin without problems (MySql root user hasn't password yet). Now I would like to execute some sql commands from MySql administrator running on a windows PC. but when I tried to open the connection the error 1130 appears. What can I do to do SQL queries from Windows (or any other supported OS) to MySql server? Host server has firewall disables (to avoid any problem).
View Replies !
Query Browser Session
i've used ms sql server for years, but i'm trying to get a handle on mysql. i'm using the query browser, trying to write a query that creates a mysql table, puts some stuff i there, and then selects. i can write it in a query tab and execute it, but i don't see my resultset, so i don't know for sure if it's working properly. i opened a result set tab and put the query in the toolbar and tried executing, but i think it executes each part of the query (separated by a semi-colon) in a new session, so after i create the mysqltable, i can't do anything with it because it's already destroyed.
View Replies !
Set The Default Session Variable
In mysql command, there is session variables. I know it could be set dynamically by SET command. But where could i set the default value for session variables? I do not want to change it every time i enter in a session.
View Replies !
Session Table Keeps Crashing
I have read that if storing sessions from a PHP application in the dB (mysql) that the session table often crashes. Is there any reason this is happening or a way to prevent it?
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 !
Mysql Sql History(cross Session)
I have found many docs to see is there any way to figure out how can mysql store the typed words or sql(whatever it is a valid sql or not) so that we can just use "arrow up" or "arrow down" easily to move to the previous sql or even some sqls typed yesterday or in different sessions(such as by putty/konsole) that is already logged out ? Does anyone have any clues about this ? I think that it should be done by setting some mysql server vairables but i didn't see any mentioned in the mysql docs.
View Replies !
Temporary Table Can Act Like Session Variables
i m looking to use a temporary table that acts more like a SESSION variable does in php. i use other temp tables in the site im working on and they go away after the sql connection is closed at the end of the page. i was wondering if theres a way to create a table that is there for a certain time period, or the best would be, like i said earlier, to act almost exactly like a session variable.
View Replies !
Mysql.user.password In Session
I have set up a few users in the mysql Privileges and with my php pages I have them log in with a form (login.php) to access the next page (mainpage1.php) that generates info from the mysql db.I know it is not really secure to just have the plain text password stored as a $_SESSION['pw'] as I have now. but how should I store it in a Session to be used in other pages without the user having to enter it in each time the page wants to go to the db? Or can we store the $Link in a session? or somehow have it remember that the user is connected?as if I sha1() the password how do I get it back into a format that mysql recognizes?What is the best way of doing this?
View Replies !
Update A Field Using Session Variable
I am trying to update a field for a spacific row using a session variable from a previous page sql = "SELECT p.`P_Visible` FROM mysqlreddot.p_heading p WHERE p.`P_HeadingID`=Session(ewSessionSysAdmin) ");" but i am getting errors If hard code a row id then it work fine sql = "SELECT p.`P_Visible` FROM mysqlreddot.p_heading p WHERE p.`P_HeadingID`=25");"
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 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 !
Last_Insert_ID() Of A Table Or In A Session For Stored Procedure?
Does the 'Last_Insert_ID()' return the last ID entered into the table or the last id entered into in a session (this would be a stored procedure). i.e. In a multi-user system, if I use this to return say an invoice number could I get the wrong number back? 1>User one runs insert SP that Inserts Record 2>>User Two runs insert SP that Inserts a record 3>User One: Script now calls Last_Insert_id() Does the script at (3) return the ID from the insert at (1) or (2)?
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 !
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 !
Save Changes
I'm working on a membership database (MySQL 4.1) with about 350 members. The client wants every change made to be recorded so that there is a record of what was changed. So they want what row was changed, what was changed within that row, when it was changed, and who made the changes. Is there a way to so this automatically in MySQL or do I need to set up a new table and alter all existing queries?
View Replies !
Insert_id Save
The problem: I fill one table with something, then grab the insert_id from it. Then i add that insert_id to another table to link the two together. This is for making an account. The problem: what if multiple users make an account at the same time and the queries get mixed up? E.g. these are run before insert_id has a change to kick in insert into table1 by user1 insert into table1 by user2 insert_id then gives me the insert_id from user2 while i was expecting the one from user1 Will this be a problem and if so how is it best solved?
View Replies !
|