Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MYSQL


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Assigning Values To Records In Database Based On Random List


I have a single database table contains several hundred records (the data is not important). I need to be able to assign a random value from a list (say: 10, 15, 20, 25, 30) for every record, for an specific field in the table, say the field called "category_id".




View Complete Forum Thread with Replies

Related Forum Messages:
Retrieve A List Of Values Based On The String Length
Code:
$qry = "SELECT ID WHERE (SELECT CHAR_LENGHT('field_1') FROM tab = 8)";

View Replies !
Selecting Values For This Record Based On Other Records
Is it possible in a select to reference the contents of a column in a different record to the one currently being assessed?

Kind of like :-

Select id,prev_id,title,flag FROM my_table WHERE flag != "S" AND flag(prev_id)="S";

What I'd like it to do is select records which have flag set "S", but the record referred to in prev_id do not have flag set "S".

If it matter, I'm stuck on 4.0.

View Replies !
How To Insert New Records Based On Previous Record Values?
I have
TABLE:

year
value

It has for example,

year, code, vlaue
2007, 33, 4883
2006, 33, 4883
2007, 32, 4883
2006, 32, 4883
2008, 31, 4883
2007, 31, 4883
2006, 31, 4883

I want to insert new records for for 2008 for all codes that do not already have a record for 2008 and increase the value for the 2008 record by 3%.

My several attempts have led to this but which does not work.

UPDATE TABLE a
SET a.value = b.value * 1.05
WHERE b.year = 2007
AND code NOT IN
(SELECT code
FROM TABLE b
WHERE year =2008
AND value !=0)

View Replies !
Group Records? Only List Users With Only NULL Values
I have this result-table (running on 4.0.24), how do I collect all o_user_id which does not have NOT NULL value in reciept_id?

(I do not want the 745-user in result, as it contains a value for reciept_id)

+-----------+------------+-----------+-----------+-----------+---------+
| o_user_id | reciept_id | r_user_id | d_dist_id | r_dist_id | item_id |
+-----------+------------+-----------+-----------+-----------+---------+
| 745 | 18 | 745 | 1 | 1 | 1 |
| 745 | NULL | NULL | 2 | NULL | 1 |
+-----------+------------+-----------+-----------+-----------+---------+

View Replies !
Assigning Unique ID To Distinct Values
I have a table `books` with booktitle and authorname columns. In my
applicatoin booktitle has unique values but authorname doesn't. ie an
author can have many books but not the other way around.

I need to add more author info in the database. So I need a new
`authors` table with authorname as a column (along with address, email,
phone etc) and an authorid primary key. Then I need to replace
books.authorname column with a column containing the corresponding
authorids

How can this be done in sql?

View Replies !
ORDER BY List Of Random Ids
I have a list of id-numbers, for example (4,19,2,5).

Now I need to get rows from a database in that order, 4 first, 19 second and so on...

Is this even possible to get the rows in such a special order? I now have select statement like:

SELECT stuff FROM TABLE WHERE id IN(4,19,2,5) ORDER BY ??? but of course that returns the rows in order 2,4,5,19,

View Replies !
Eliminating Values From A List / Finding Non-existing Values
I have a list of thousands of values, some of which exist in the database, and some of which do not. I'd rather not loop through the list, SELECTing each item to test its existence, and was wondering if there's a more elegant way to do this using an SQL statement. For example:

Database:
1
3
5
6

List:
1
2
3
4
5

I'd like MySQL to return to me the following, a list of the non-extant items I passed:

Result:
2
4

View Replies !
List Available Items Based On Prerequisite Table
I'm trying to develop such a scheme:

TABLE Prerequisites
PrerequsiteID (FK to Upgrades table; states a prerequisite for UpgradeID in the other column)
UpgradeID (FK to Upgrades table as well)

TABLE BuildingUpgrades
BuildingID (FK to Buildings table)
UpgradeID (FK to Upgrades table; states what Upgrade Building already has)

So it's a Building -> Building_Has_Upgrades -> Upgrades -> Upgrades_Have_Prerequisites thing (Building has 1..n Upgrades, Upgrade has 1..n prerequisites). In order for Building B to have an Upgrade U, that Building B has to have all the Upgrades which are required to have Upgrade U.

What I want to do is to list all buildings with all upgrades available for them. I've been trying for almost whole day to solve this issue with different inner, left and right joins, subqueries and what not but I can't really do it in a clean way.

The only working thing is a query, which I am ashamed of because it seems like a real waste of CPU time to me:

SELECT BUPG.BuildingID, PRE.UpgradeID, COUNT(PRE.PrerequisiteID)
FROM BuildingUpgrades BUPG
JOIN Prerequisites PRE ON BUPG.UpgradeID = PRE.PrerequisiteID
GROUP BY BUPG.BuildingID, BUPG.UpgradeID
HAVING COUNT(PRE.PrerequisiteID) =
(
SELECT COUNT(PrerequisiteID)
FROM Prerequisites
WHERE UpgradeID = PRE.UpgradeID
GROUP BY UpgradeID
)

What it basically does is takes all the available Upgrades, counts prerequisites that have been met by the building and checks if it's equal to the number of all prerequisites for that Upgrade. And it works but I still think there is a much better way to do it.

View Replies !
Query For Month Data Based On Occurance Against Master List
I have a query running nicely. Now I'm trying to expand it.

It pulls the data from a table based on matching the id with another table and part of the grouping is by month and 2 other criteria. Now I'm trying to get the data pulled by month to pull only the info where the id matches the master file AND the FRANID's pulled are the same for each month. I'm trying to get a comparisson across times, but not every month has all FRANID's, depending on when they were entered and I ony want data that exists with matches over set months, starting for now with 12, perhaps also for 6 and 3 next time.

I've simplified what I'm doing above, but it is detailed below.....

View Replies !
Get REALLY Random Records
I've been using this as the alternative to RAND() which is damn slow on tables with lots of records:

SELECT t1.id, t2.id AS t2ID
FROM table1 AS t1
LEFT JOIN table2 AS t2 ON (t2.id = t1.t2_id)
JOIN (SELECT FLOOR(MAX(id)*RAND()) as id FROM table1) AS rt ON t1.id >= rt.id
WHERE t1.active = 1
LIMIT 1

Now the problem is when i change "LIMIT 1" to "LIMIT 5" for example, the records pulled out of the table are not really random. Only the first record is random! The 4 remaining records are just record 1 + 1.

So, the result for "LIMIT 5" is:

1st record: id=34 (totally random record)
2nd record: id=35 (not a random record but 1st record + 1)
3rd record: id=36 (not a random record but 2nd record + 1)
and so on..

It just adds + 1 to first record.

View Replies !
Random Records
I'm trying to get a random record for use with my website. I've tried figuring out some premade code and it's led me nowhere..

Here's basically the rundown...

I have a database setup by my site's shopping cart system, and in it are 2 tables i need to read from, "specials" and "featured". I want to pull 4 random entries from "specials" and 1 from "featured" to have posted on my site's main page outside of the store.

I know how to connect to and select the database, I even know how to send queries, but the whole selecting a random entry is what's got me at a brick wall.

I'm not used to PHP and MySQL, i'm just now learning after 4 years of using Perl(and never using a database system, but creating my own database-like files).

View Replies !
Select Random Records Amongst Last 10
Never came across this kind of probelm, I suppose there's a simple answer...

I need to select 2 random records amongst the, say, 20 last entered records of a table (theres a date field).

For example, I wish to display random products on the front page of a website, but since people come to this site to see new products, I would like these random products to be selected from the last ones that were entered.

I thought I could put a date clause and a rand order, to restrict to the records to the last x days, but it is not an option because this could result in no records being selected, since in theory this chosen limit could be nearer than the last record entered.

My other option would be to use PHP to fetch random rows in a recordset of the last 20 records selected through mysql, but I wonder if there's a way to do it directly in a mysql query.

View Replies !
Random Empty Records
I run a WAMP webserver and host an online entry form for a local running race. I'm getting random empty records inserted into the database. For every 50 or so legitimate entries, I get a blank record or two. A few people have said they signed up, but their infomation is not in the database. At first I thought it was user error, but now I'm not so sure. Has anyone else experienced a problem with random blank records inserted in thier database? Any guesses?

View Replies !
ORDER BY :: Random Records
I'm trying to have the first column (home) order by ascending while randomizing. The problem is that my second order gets affected by this as well. Is there a way I can randomize column1 while having column2 to stay put without using UNION?

ORDER BY `column1` ASC,RAND(), `column2` DESC

View Replies !
Random Select Records
I've got a question about a query in MySQL. I would like to random select records from a table. Everytime the query will execute the resultset need to be diferent (random selected records from the table).

View Replies !
Select One Distinct And Several Random Values In One Query
I'm wondering if it's possible to select an id (let's say its 13) and several random id's between 1 and 100 in one query, excluding for example the id's 14 and 15.

I've tried different ways with UNION - but when I include 'order by rand()' in my query, I'll never get the id 13 back. Could anybody help me please?

Here's a query which did not work, because i will always get the the same result, without random values:

SELECT * FROM table WHERE id = '13' UNION DISTINCT SELECT * FROM table WHERE id != 14 AND id != 15 AND (id BETWEEN 0 AND 100) LIMIT 3

View Replies !
Selecting From Two Tables Random Records
I have two trivia tables of questions and answers that I want to select from. I need to select 6 random questions from one, and 2 random questions from the other.

I tried variations of:

(select * from table1 order by rand() limit 6) union (select * from table2 order by rand() limit 2)

View Replies !
Random Ordering Of The Lastest 6 Records
I want to show a random ordered list from the latest 6 records in my table..

I tried this:

"... ORDER BY RAND(), date DESC LIMIT 0, 6"

But it didn't work and it kept showing me 6 records but not "newly" added.

View Replies !
How To Quickly Find Random Records
I've got a table of 117,000 records and I want to return 5 random records. I've tried:

"select * from table_name order by rand() limit 5;"

but it's too slow, requiring perhaps 2 seconds to execute. Is there a faster way to do this?

View Replies !
LIMIT Based On Unuiqe Values
i have a query where i search the table on the table using an alias (a in this case) and then find all rows for that user using the alias b, but now i need to limit the results to say 5 unique rows from table a but allowing any amount from table b, also table a may return multiple uids for one user

Code:

SELECT b.uid, b.field, b.value FROM user_s as a, user_s as b WHERE b.uid=a.uid <where clause for table a here> GROUP BY b.field, b.uid ORDER BY uid

View Replies !
Selecting Values Based On Column
I couldn'y find solution to this on forum so here it is :

sample table :

id | name | value
1 | x | y
1 | z | v
2 | x | y

i would like to select id where x=y and z=v.

so in this case result should be : 1

(2 is not in the result coz it doesnt match x=y).

How to create such a query?

View Replies !
Random Records :: Rand() On Large Tables?
Im told that ORDER by rand() isnt a good idea to use on large tables, so Im interested to know how else this could be done. I need to display 20 random records (there are conditions in the WHERE clause as well).

View Replies !
Enforce A Certain Constraint Based On Several Records
I'm trying to create a table "Works_In" as follows:

CREATE TABLE Works (
EID INTEGER NOT NULL,
DID INTEGER NOT NULL,
PctTime INTEGER NOT NULL,
PRIMARY KEY (EID, DID, PctTime),
FOREIGN KEY (EID) REFERENCES Employee (ID),
FOREIGN KEY (DID) REFERENCES Department (DID) );

The PctTime field shows the percentage of time that a given employee works in a given department (one employee can work in several departments).

My question is: how can I enforce that the PctTime value <= 100 ??

For example if the employee "John" works in Department "1" 20% of the time, and in Department "2" 80% of the time...how can I make sure that the total percentage is equal to 100%...

View Replies !
Getting Records Based On Chars In A String
I have a table with 2 fields. Field 1 contains Names. Field 2 contains a single character A,B,C,D or E.

I have a string "BCE" for which I want all the names that contain one of those characters (B,C, or E). For Example:

Field1
======
Jo
Ron
Mary
Sue
Mark
Frank

Field 2
=======
E
D
A
C
D
B

Desired Result after Query:
===========================
Frank
Sue
Jo

SELECT * from TestTable Where Field2 = SomeFunction("BCE")

How can I do this using a SELECT statement?

View Replies !
Order Records Based On Two Columns
I'm working on PM feature for my site. So far I have this table:

+-----------------+-----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+-----------+------+-----+---------+----------------+
| ID | int(11) | NO | PRI | NULL | auto_increment |
| subject | char(100) | YES | | NULL | |
| body | blob | YES | | NULL | |
| r_id | int(11) | YES | | NULL | |
| s_id | int(11) | YES | | NULL | |
| date_sent | int(11) | YES | | NULL | |
| date_read | int(11) | YES | | 0 | |
| r_date_to_trash | int(11) | YES | | NULL | |
| s_date_to_trash | int(11) | YES | | NULL | |
| r_status | int(11) | YES | | NULL | |
| s_status | int(11) | YES | | NULL | |
+-----------------+-----------+------+-----+---------+----------------+

r_id - "Receiver's ID"
s_id - "Sender's ID"
r_date_to_trash - "Unix timestamp when receiver deletes the message"
s_date_to_trash - "Unix timestamp when sender deletes the messages"
r_status - "receivers msg status, if r_status == 1 then message is in the trash
s_status - "senders msg status, if s_status == 1 then message is in the trash

So this is the query I have right now:
SELECT * FROM pm WHERE (r_id = 1 AND r_status = 1) OR (s_id = 1 AND s_status = 1)

This is the result:
+-----+------+------+-----------------+-----------------+----------+----------+
| ID | r_id | s_id | r_date_to_trash | s_date_to_trash | r_status | s_status |
+-----+------+------+-----------------+-----------------+----------+----------+
| 104 | 1 | 2 | 1226972079 | NULL | 1 | 0 |
| 110 | 1 | 2 | 1226971762 | NULL | 1 | 0 |
| 111 | 1 | 2 | 1226971891 | NULL | 1 | 0 |
| 112 | 1 | 2 | 1226972033 | NULL | 1 | 0 |
| 113 | 1 | 2 | 1226972462 | NULL | 1 | 0 |
| 120 | 2 | 1 | 0 | 1227103836 | 0 | 1 |
| 122 | 2 | 1 | 0 | 1227103841 | 0 | 1 |
| 127 | 2 | 1 | 1226972346 | 1226972090 | 1 | 1 |
| 128 | 2 | 1 | 0 | 1226972095 | 0 | 1 |
| 129 | 2 | 1 | 0 | 1226972176 | 0 | 1 |
| 130 | 2 | 1 | 0 | 1226972396 | 0 | 1 |
+-----+------+------+-----------------+-----------------+----------+----------+

This is the problem:
I'm trying to list the messages that are in the trash in order by date they were deleted (r_date_to_trash, s_date_to_trash). I need to join these two fields somehow together and then I could just do ORDER BY whatever DESC. That way the messages in the trash will show up in the order they are deleted.

View Replies !
Getting A Count Of Records Based On Inner Relationships
I am making a PHP-MySQL forum. I have a table "forum" that holds all the posts.

Fields in forum: ID, user, title, body, threadID, datePosted.

All top level posts (ie, original posts for a thread) have a threadID=0. All other posts are comments, hence their threadID is set equal to the 'ID' of the original thread post.

I can get a list of the last 10 top level thread posts:
select * from forum where threadID=0 order by ID desc limit 0,10;

Also, I can get the # of comments for an individual thread (for instance, thread # 37):
select count(*) as Expr1 from forum where threadID=37;

How in the heck do I form those two statements into one statement? In my main forum view where I list the last 10 threads, I want returned in each result set the ID, title, user, and the # of comments posted in that thread.

View Replies !
Marking All Records Based On A Text File
I have a large list of email addresses that I have found are undeliverable
to users, I want to mark a field in mysql to 1 where there is this email
address, how can I do this in one go from a file. Code:

View Replies !
Combining Multiple Records Into One Based On A Key Field
I'm really scratching my head over this one. I'm working with CSV data exported from Excel, which explains why it's a mess to begin with.

Within a table (or via any other means someone might be able to recommend) I need to combine multiple records which share two like fields. (If that's not clear, the real-world explanation is below.....

View Replies !
Selecting All Records Without Dups Based On One Field?
I have a table with 5 fields, of which several sometimes have
duplicates.

example;

| id | item | day | hour | ip_address |
| 1 | 3 | 2 | 11 | 204.156.33.78 |
| 2 | 7 | 2 | 15 | 122.165.177.211 |
| 3 | 1 | 3 | 1 | 205.52.79.122 |
| 4 | 7 | 3 | 9 | 122.165.177.211 |
| 5 | 11 | 3 | 9 | 177.15.99.111 |
| 6 | 24 | 3 | 17 | 122.165.177.211 |

As you can see the ip address may obviously have dupe entries (as do other fields but I don't care if they are dupes) and I want to query the table and get all the fields but only one where there is dupe ip_address 's.

So that I would get these results;

| id | item | day | hour | ip_address |
| 1 | 3 | 2 | 11 | 204.156.33.78 |
| 2 | 7 | 2 | 15 | 122.165.177.211 |
| 3 | 1 | 3 | 1 | 205.52.79.122 |
| 5 | 11 | 3 | 9 | 177.15.99.111 |

View Replies !
How To Group Similar Records Based On Their Content?
I have a table that holds logging information. It contains 3 columns:
Message_ID: The ID of the message (primary key)
Message_Datetime: The datetime when the message was posted
Message: The actual textual message (varchar(255))

I would like to know what is the distribution of the various messages. What I want to perform is a query that will return the number of messages of each type, where the type is defined by the first 10 characters of the message.

What I mean is that all the messages that begin with the same first 10 characters should be grouped together.

I want to have a query that will display for each group, the number of entries. This way I will be able to sort the results and will know what is the most common message group.



View Replies !
How To List Duplicate Values In A Column?
I have a large table which has duplicate values in one of the columns. I can easily see how many duplicates there are by using COUNT and DISTINCT, but I can't see what the duplicates actually are.

I guess there's a simple way to list duplicates, but I can't get my head round it.

View Replies !
Partially Updating Records Based On Pattern Match
I would like to know if it is possible to a (string) replace on
existing records based on a given pattern.

Let's say I have a table containing the following records (strings):
Windows/98
Windows/98/Registry
Windows/2000
Windows/2000/Registry

Is there an SQL method for scanning all records in the
table for the pattern "Windows/98" and then, when a match is made, replace
only the "Windows/98" part of the string with "Windows/2003"?

I am having a hard time figuring this out.

View Replies !
Extraction Of A Substring In A List With ; Separated Values.
In my database, a have a table with a field which you can put many values with a ; between each. The software is done like this.

Exemple: Field: Version
Data: 3.0.1;1;2;4;5.1.2 etc.

I want to extract all entries in the database with version = 1.

The problem is that the result give me entries with version 3.0.1 , entries with version 5.1.2 and entries with version 1.

As you probably guess, I just want entries with version = 1.

I tried with WHERE (version IN ('1;')) but it returns nothing except entries
which version is only 1; I need something to find a substring = 1; with nothing in front
of the 1 or substring = ;1;....... something like that... or better way.

View Replies !
Selection Of Records In List
I was wondering how to query MySQL to display only a selection (1-20, 21-40) of a query in an HTML list. Can that be done in an SQL statement, or do you have to use PHP to dissect the returned array
with for n elements to n+20 elements. How does Google achieve the returning of results in its search engine. I imagine that the same query may not necessarily be executed each page listing. I am wondering whether the results from the query would return an array of say 36000 elements.

View Replies !
Get List (count) Of Records
I want to get a list of records with duplicate (or triplicate, etc.) fields.
I tried:

SELECT *, count(*) as q FROM test WHERE q > 1 GROUP BY field1;

This didn't work because "q" is regarded as a missing column. Is there a
way to do this in a single SQL statement?

View Replies !
List Of All Same/redundant Records
is there a way how to list all same records from one table?
eg: comapny_name: abcd - 12 x, xyz - 20x, abcd123 - 1x, bcbcb -5 x etc...

my qoal is to indentify all redundant records and delete them and let just one record. deltetion can be done by php.

View Replies !
Deleting Records List
I would like to delete records from a table - how do i want to do is.

First, i want to list all the topics from one table and when i select a topic, i want to show all the sub-topics from another table.These two tables topics and sub-topics have relation.NOw, i want to select a sub-topic and corresponding article names have to be displayed and at the end of each article name, i want to show a check box and when i check this box and hit the delete button, the record has to be deleted.i.e, the article name has to be deleted for the corresponding sub-topic and to the topic.

View Replies !
MySQL Command To List Enum Values Of A Column? - ALL SET
I'm wondering if there is a MySQL command to list all the enum values of a given column. For example, I have a column defined as:

sgroup enum('none', 'aaaaa', 'bbbbb', 'ccccc') not null
What command can I run to get the list of these possible values?

View Replies !
Select With Multiple Primary Keys Against List Of Values
I have created a method that automatically parses the metadata of a specified table and searches each field to effectively create a database search.

The way it currently stands, it only supports tables with a single PK. Basically it returns a string that can be appended to the WHERE clause in a SELECT.

i.e. "ID IN (1, 2, 3, 4)"

Basically the PK field name and a list of matching PKs from the search.

I realized though that this will break if I have a table with multiple primary keys.

An elegant solution for this eludes me, and that is what I am asking for input on.

Right now I can only think of returning something like :

"(ID = 1 AND SSN = '123121234')
OR
(ID = 2 AND SSN = '432434321')
OR ..."

This obviously would become a monster if many results were returned.

And if I did something like :

"ID IN (1, 2) AND SSN IN ('123121234', '432434321')"

This will either return false positives or nothing at all ...

Is there a better way for me to create this conditional?

View Replies !
List The Number Of Records In Query
I have a very simple query. I want to list a bunch of names & how old they are. (two columns) I want to add a third column that basically counts how many records there are.

Example:

1. Bill Jones - 55
2. Bob Smith - 56
3. Steve Gates - 25

Can I do this in mysql or should I add the code in PHP, and how do I do it?

View Replies !
Selecting Multiple Columnn Values Into 1 Distinct/unique List
I have a table with several fields for email (primary email, alternative email, contact email)

Some times, some of these fields will be blank and sometimes the same address will be enter for both primary and contact.

I use this table and these fields to do a mailout but I don't want to mail people twice because there address occurs in more than 1 column.

I need to end up with a list containing all email values from those 3 columns that is unique (no duplicates).

I can do this by checking each one and putting it into a php array but thought there may be a nicer way to do it in the SQL?

View Replies !
Get List Of Tables Containg Specific Records
I have a database with 20+ tables that contain data from various instruments. Samples can be measured on any combinaiton of instruments and I would like to be able to query the database to find which tables have data for a specific sample, with the table names being returned to build a dynamic web form for selecting and viewing data.

I can build sort of brut force queries via php to do this to mitigate re-writing webpages when additional tables are added, but it seems to me there should be an elegant solution (or at least brut elegant) to this.

View Replies !
Browsing Records: (first, Prev, Next, Last) And Getting A List # Like Item # Of ##
Very simple database to store comics, I'm trying to start small with PHP and MySQL.

table name: comics
Fields:
ID: int auto-increment primary-key
title: tinytext
date: date
location: text (stores the relative file location, "images/comics/1.jpg")


So now my trouble...

In a perfect world, the database ID field would one day have 100 records with ID numbers 1-100 consecutively. In the real world I see myself having to delete entries for whatever reason which will leave gaps in the ID field.

Is there a mysql command to go to the next entry that comes after a certain ID number? Same with previous.

Is there a way to find the highest number ID in the database quickly? The lowest?

Finally, I would like to display something such as "Comic X of XX". XX is easy, I can just use count. But if I retrieve ID 22, how do I know how many records came before it without doing something like looping through the database in PHP and running query for each preceeding ID#? I assume that PHP loop method would be time consuming and a poor use of resources? Or would that actually make sense?

Sorry for the newb questions. The book I bought was more reference than tutorial, I didn't have enough time to pick one out properly which leaves me floundering a little with the basics.

View Replies !
Random For Displaying Rows From Database
I did query and get all of the rows in my table test . Each row in my database include fields like this : id , ask , a , b , c , d , answer . All are 7 fields . When display on a page i want it to be displayed in inorder , in random the with the field ID and in the row the 4 fields a,b,c,d are all displayed in an inorder too .

Telling this is so hard to imaging so i am trying to put an example here . This is a projest of mine , doing the work of a test with a question and 4 choies for ppl to choose the answer . Code:

View Replies !
Using A Web Based Database
My web site host allows me to create MySQL databases on its database server. I've created a database as a trial. Now I would want users of my website to supply data to the database and for me to be able to extract it for analysis.

View Replies !
Selecting Records Containing Multiple Values
I want to query a database for records with which the field 'network_letter' contains G,R,M, and Q and display those results back. Is there an easier way than doing the following:

$query1 = mysql_query("SELECT * FROM global_pops WHERE network_letter='G'");
$query2 = mysql_query("SELECT * FROM global_pops WHERE network_letter='R'");
$query3 = mysql_query("SELECT * FROM global_pops WHERE network_letter='M'");
$query4 = mysql_query("SELECT * FROM global_pops WHERE network_letter='Q'");

and then merging those results into one variable and printing them?

View Replies !
How To Create New Database For Job Portal Based On Industry
I have planned to create the job portal based on Industry like IT ,Pharma,banking,Airlines,Sales.

Option 1:

I have decided to create the seperate DB for each Industry but maintain the user account details in common DB

For example , Main DB is jobportal contains all useraccount details and common tables like country ,state ,city,designation in common Db

other 5 DB are IT ,Pharma,banking,Airlines,Sales .

Connect Main DB with all other DB..

View Replies !
Database Sync Based On User-login
I really want to know if it's possible to tell a mysql database to sync whatever changes are done on it BY A PARTICULAR USER to another database.

This sort of logic:

If UserX logs in
then whatever changes he makes: sync to secondary DB.
Else
do nothing;

Is this possible?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved