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




Whats Needed On Client PC And Server?


I'm currently using MySQL 5.0.9 with Visual C++ 6.0 and Qt. My project is on the server, with all the dll's needed as well as MySQL with my database. I can only access my database on the server from a client station if this client station also has MySQL installed. It doesn't even execute the queries in my code.

Do I need to use server scripts and if so how do I do it? Is there in Windows something like a mysql-server and mysql-client package? Do we need to install MySQL on all of the client stations?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Client Does Not Support Authentication Protocol Requested By Server; Consider Upgrading MySQL Client In
I have recently upgraded to MySQL 5. Got this error message in my IE Browser. Have read some of the comments on other forums and my choices are: Upgrade all client programs to use a 4.1.1 or newer client library, or

SET PASSWORD FOR
-> 'some_user'@'some_host' = OLD_PASSWORD('newpwd')

Can someone please advise?

Mysql_connect(): Client Does Not Support Authentication Protocol Requested By Server; Consider Upgrading MySQL Client
Basically I am setting up php,mysql and apache to run an application. While trying to connect I get the following error:

Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in c:sudhirapachehtdocssvgmap est4.php on line 14
Cannot connect to the database.
Client does not support authentication protocol requested by server; consider upgrading MySQL client
I have tried the following message posted earlier by many of you guys i.e
"SET PASSWORD FOR peter@localhost = OLD_PASSWORD('something')
flush privileges

I am trying this from a long time and do not find a way to fix this problem
I request you guys to help me in soughting this out and I appreciate your patience in reading my post.

Mysql_connect(): Client Does Not Support Authentication Protocol Requested By Server; Consider Upgrading MySQL Client
I am having an awkward problem with my MySQL installation. I have a number of scripts that access the database from a few different web hosting sites. I have no problem accessing the database from the scripts that I host locally. The scripts that are on an outside server accessing the database gives me a mysql_connect() error.

Locally I use MySQL 5.0 and PHP 5.0. I am assuming that the 3rd party web host uses an older version of PHP and thinking that may be the problem. Is this the possible problem and if so is there a way to fix it without ruining the scripts that are currently working?

Server-Client
------=_NextPart_000_004C_01C3507A.4005F3F0
Content-Type: text/plain;
charset="windows-1254"
Content-Transfer-Encoding: quoted-printable

Hello,
I coded a program by using VB 6.0 I will use this program on =
network(nearly 12 user). is it necessary to code two different program =
for both of server and client. Or, Can I solve this problem by MYSQL =
Control Center.

H=FCseyin DEM=DDRA=D0
=DDstikbal Furniture =DDnt.


------=_NextPart_000_004C_01C3507A.4005F3F0--

Server-Client
I coded a program by using VB 6.0 I will use this program on =
network(nearly 12 user). is it necessary to code two different program =
for both of server and client. Or, Can I solve this problem by MYSQL =
Control Center.

Fw: Server-Client
I think that I should ask the question like that.
I want to run MySQL on 14 client. What am I do. I try but There is a problem
that i can't find.

Server Vs Client Version
I have a server where the mysql Server version is 5.0.27 but the client version 4.1.12. I know if the client version is newer than the server then its the server version that counts - is it the same the other way around?

VB + MySQL Client Server Application
I would like to know about what the most important things to be installed in every workstation if I will used VB and MySQL using the ODBC driver. Is there a need to install VB, MySQL, ODBC Driver in all computers? If possible can you give simple snippets in configuring MySQL and ODBC in VB code.

Apps Use MySQL Server Or Client Version?
I am using a shared hosting setup and I'm trying to figure out which version of MySQL my applications are actually using. My host tells me that the MySQL server is running version 4.1.16, but when I do a phpinfo it shows client version 5.0.16. Since some scripts don't support MySQL 5, I am trying to clarify which version my applications would actually use. Any ideas?

Controlling The Server -> Client Fetch Size
I see that mysql_use_result() and mysql_store_result() allow you to retrieve results into the client memory space either a single row at a time from the server or the entire result set from the server.

Is there a way to control the fetch size so that, say, I get 100 rows back from the server at a time? Cursors would probably do the trick, but then you can't build things in 'C'.

Frontt-end For Mysql In Client-server Setup
What opensource software would you recommend for the front-end in a
client-server setup for mysql

Client Does Not Support Authentication Protocol Requested By Server
i have this message when i try to use 'mysql_connect' command in php. error message :

Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in c:program filesapache groupapachehtdocs7mysql_test.php on line 2

#1251 - Client Does Not Support Authentication Protocol Requested By Server; ...
I am trying to get phpmyadmin working with mysql but I get the below errors...
Why is this??

"phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server."

and...

" #1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client "

changes in config.inc.php file:

$cfg['PmaAbsoluteUri'] = 'http://localhost/phpmyadmin/'

$cfg['Servers'][$i]['auth_type'] = 'config'
$cfg['Servers'][$i]['user'] = 'root'
$cfg['Servers'][$i]['password'] = 'pword'


Any ideas if I am missing something?

How Do I Setup The Server On A Network Drive For Client Software To Access?
I'm building a database system for our department at work and have successfully installed the MySQL Server 5.0 to my local machine and developed my user interface to access it read/write/update, etc. just fine through VB6 and the ODBC driver.

My problem now is how do I get the database files and server functions moved/transplanted/installed on a network share drive (Windows 2000) that my peers and I have access to, so that I can deploy me client user interface onto their machines so we can all access the database across the network and I can get the files off my local hard drive?

Remote Access Not Working: Error 1251 Client Does Not Support Authentication Protocol Requested By Server
I'm trying to set up my MySQL database for remote access. I've never been a DB admin so this is all mostly new to me. I am binding to my public IP address, and I have created a new user with the following grant commands run from the mysql command line on the server:

mysql> grant all privileges on prs_data.* to 'username'@'%' identified by 'change';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on prs_data.* to 'username'@'localhost' identified by 'change';
Query OK, 0 rows affected (0.01 sec)

When I try to connect remotely from another host, here's what happens:

Remote Connection To MySQL DB Server From Client With No MySQL DB
I have MySQL server running on a Solaris machine. I have a Perl tool that is run on multiple operating systems (Linux, Solaris, MKS on windows, CYGWIN on windows). I would like to post to the MySQL database on the Solaris machine from this script when it is run on the different local clients. All these clients share a single network share (available via Samba on windows).

Is there a Perl module that I can install in the network share that I can use to connect remotely to the server DB?

Whats A Union?
I know how to create a join - correct me if I am wrong, but its
something like the following:

SELECT contacts.firstname,contacts.lastname,address.line_ 1
FROM contacts,address
WHERE contacts.address_hash='$myhashkey'
AND address.hash='$myhashkey';

I have seen mixed references in my books about unions and joins that
make me think they are in some way related. My Core MySQL book, which I
think is great, is unfortunately not clear enough for my head to grasp.

I'd appreciate if someone would could give me a real and an imaginery
world example (thus sample code and perhaps compare apples and oranges
in a shopping list or whatever)...

Whats Wrong With This Syntax?
Here is my query:

UPDATE 06_acct_pg_status SET status = 3, last_update = NOW() WHERE pg_id = 10;

It worked when it was:

UPDATE 06_acct_pg_status SET status = 3 WHERE pg_id = 10;

Adding "last_update = NOW()" is what is problematic.

Whats The Point In Using InnoDB?
Hi,I read some stuff about this mysql engine InnoDB. Everybody's saying that this engine is so much better than the standard mysql myisam engine.
I got trough this whole chapter of the mysql tutorial ( http://dev.mysql.com/books/mysqlpres...rial/ch10.html ) and I thought it would be useful for me.
But right now while I am creating my database based on InnoDB it's all trouble for me.
Alright, I admit those Primary Key / Foreign Key relations could be handy in some ways, either the transactions could be. But now I am experimenting with this engine, I am a bit disappointed in it's features.

Like those relations: I create a relation, but after a while I want to change the column name. This won't work because renaming this field would interrupt the relation.
And those transactions, I read that if I start a transaction, both queries won't be executed if one of them fails. But in reality, that's not working every time. Cause if one of them didn't get executed because, for example, the query isn't well, the other query will still be executed.

I even heard some rumors about MyISAM being faster than InnoDB? I looked around on this forum and I saw this page of benchmarks: http://www.mysqlperformanceblog.com/...hmarks-part-1/ . This one shows that InnoDB is faster than MyISAM.


Whats Wrong With This Sql Query...
$query = "SELECT distinct loguser.icnumber,access.acccode,dealerdtl.name,loguser.fullname,access.period,staff.staffname,
amount.amount,
DATE_FORMAT(access.actdate, '%d-%m-%Y ')As formatteddate1,
DATE_FORMAT(access.expdate, '%d-%m-%Y ')As formatteddate2
FROM dealerdtl,amount,staff,dealer,loguser,access where access.icnumber=loguser.icnumber
AND dealer.dealercode=dealerdtl.dealercode AND staff.sid=amount.staffcode
AND loguser.icnumber = '$custic'";
This query select multiple rows, how to configure it for one row...

Whats Wrong With My Query?
Whats wrong with this?

SELECT * FROM listings WHERE title REGEXP "^$this->letter" ORDER BY title ASC

$this->letter is the variable .....

Selecting By Date...Whats Better?
For example you want to select blog posts from a table by year (2007) or combination year and month (2007-02). Whats better where-clausing the date column with ....

Whats Wrong With This Query. Using Now(). >= And <=
I have a table with these fields "bought" and "expires" and the date for these are "2006-06-10 10:52:35" and "2006-06-12 10:52:39". but when i run this query

$getvoucher = "SELECT bought, expires, NOW() FROM book_voucher WHERE bought >= 'NOW()' AND expires <= 'NOW()'";

It doesn't find a record.

$getvoucher1 = "SELECT * FROM book_voucher WHERE expires <= 'NOW()'";
$getvoucher = "SELECT * FROM book_voucher WHERE bought >= 'NOW()'";

Its finding a row for the first statement but not the second.

Whats The Sql To Change A Table Name?
Say i want to change a table name to something else, what SQL should i be using?

Whats The Largest AutoNumber Type?
I need to know what to assign my autonumber column in my table.  I need a datatype that can count to an almost unlimited amount.. In mysql what is the data type i should use for this autonumber field?  And what will be its maximum limit.

PHP Md5 Not Same As Mysql Md5 Password-whats Wrong?
I made a user/login system that uses MD5 security for the passwords. When the person logs in, the password they enter in the html form is encrypted with md5 security and is set to match the password in the database. Here's a quick example.

//collect the post data
$username = $_POST['username'];
$password = $_POST['password'];

$password2 = md5($password);

//TEST TO SEE IF THE ENCRYPTED PASSWORD MATCHES IN THE DB, WHICH IT DON'T!
echo $password2;

$sql="SELECT * FROM members WHERE username='$username' AND password='$password2'";
$result=mysql_query($sql);

if(mysql_num_rows($result)==0) {
echo("Wrong username and/or password. Please try again.");
}
else {
echo("Login Successful! Please wait...");
}

What is wrong here? I tried various methods of placement of the MD5 function in the registration and the password that is being entered in the database is always the same, but the one from the form never matches.

Going From Client Side, To Server Side.
I was wondering: if i install MySQL, and the PhP egine on my computer, does this mean, i will have to connect my domain name, or URL, to my machine?

I am having a hard time figuring out in my head the process by which i go from having something on the client side end of things, and the server/host side of things. I know that PHP is pretty much a language that you basically have as files, much like an actual HTML page. To this end then, i realise i will simply have to load my PHP scripts onto the server in which they are supposed to work.

I am not however sure how i would do the same with MySQL. I do not know enough about the latter to know how its transferrable. So far, from what i read, i use a Console to test certain commands, like the creation of a Table, or the deletion of a Table. But how do i actually connect MySQL to a server that is not my own machine?

Whats The Difference Between Group By And Order By (was "hi Another Question")
whats the difference between group by and order by?

Help Needed With DB Structure
I'm finally get a grip on using databases in my scripts, but I'm still lacking a bit in exactly how best to construct my databases ... so I'm hoping that I might be able to get some help with that here

I currently have a MySQL database with one table called "users." In it will be held the registration information for everyone who signs up to the site: username, password, date of registration etc. etc.

Now I want to link that table with another table that will contain information regarding the car that the user drives. This information will be collected from a second form and will contain data such as type, make, year of construction, colour etc. etc.

What's the best way of linking these two tables together in order to help with running searches or scripts in the future? I was planning on inserting the relevant username into the second table as well so that I can run searches across both tables ... but is that the best way of doing it?

MYSQL Help Needed
I am having troubles trying to create my first table in mysql

I am using version 5.0

I have entered the code below in mysql:

mysql>CREATE TABLE table_name (
-> column_1_name column_1_type column_1_details,
-> column_2_name column_2_type column_2_details,
-> ...
->);

and i get the following error:

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 'column_1_type column_1_details,column_2_name column_2_type column_2_details,' at line 2

Syntax Needed
I have a table consisting of word_nr (key) and example_nr. Now i want to find out how many entries for example_nr are returned where word_nr=x and word_nr=y.
So i made something like:

SELECT count(*)
FROM mytable WHERE word_nr=x and word_nr=y

Query Needed
i have a little problem with figuring out how to make a query for a certain table. The table consists of two columns: word_no and example_no. It is very likely that an entry word_no refers to more than one entries in example_nr. Now i would like to find out how many entries with the same example_nr are there for word_nr x AND word_nr y together.

Timezone Help Needed
I am in Washington State, Pacific timezone. However, our business day runs from 7:00am-7:00am. I have found if I change the system time on the MySQL box to the Japanese Timezone this works in "fooling" the system into thinking 7:00am local time is midnight, the start/end of a business day.. the problem comes when trying to update our intranet website, with the differing timezones..the huge difference in time will not allow updates with our ppl who use front page.
(yes, I know notepad would be a better choice then front page. Not my call)

I have tried unsuccessfully to change the time zone in the [mysqld] & [mysqld_safe] sections of the startup INI file. When I try to force MYsql into the japan time zone the server fails to start and an error message pops up failed to start unexpectedly,

Performance Needed
I have two tables. One for products and one for reviews.
I have setup a detail page which displays the various fields out of the products table and then looks for all reviews in the reviews table which match the products key and display the average. All good so far.
I want to have a page which displays a whole list of the products and show their rating next to them but I'm wondering if making it search the reviews table and calculate the average for 50 products in one go is going to cause a bit of a strain on the server?
Is there another way I can do this, perhaps storing the precalculated average in the products table but how would I go about doing that?

SQL Statement Needed
How would I change in a table every reference to "ren" to "stimpy"?
If a value equaled "renTop" I want it changed to read "stimpyTop".

Two (rather Complex) Problems. Help Needed!
Problem 1

I am developing a system where members of a site can submit graphic designs to a themed pack. Members can then view and rate the submissions from 1-5. This has all been accomplished, but I have encountered one problem.

When listing the themed packs currently in progress, I want to be able to list how many submissions there are, how many of these submissions have a rating above 3.0, and how many of these submissions are above 4.0. I've been able to flawlessly count how many submissions there are without referring to their ratings with this query:

select
p.id as id,
p.title as title,
p.body as body,
p.reltime as reltime,
p.quota as quota,
count(s1.id) as subcount_ns,
from
packs as p
left outer join
submissions as s1
on s1.pack = p.id
where
s1.state > -1
and p.released = 0
group by
s1.pack
order by
p.id asc;
How can I also, within this query, count how many submissions have a rating above 3.0 and count how many submissions have a rating above 4.0? I'm not sure how to do this, since I have already joined the submissions table to the packs table.

The ratings table (sub_ratings) looks like this:



id | subid | userid | rating | time
The subid column refers to the submission's id, the userid column refers to the id of user who rated the submission, and the rating is an integer between 0 and 5.

--------------------------------------------

Problem 2

For the submission system, some users choose to collaborate with other users on one submission. In this case, both of their userids are grouped together in the "creators" column of the submission, being separated by commas. Here is an example:

1,43,65

This would be an example of three users having collaborated on one design.

Is there any possible way that I could, within one mysql query, determine the usernames of each of those users and return it as a column with the requested submission? I'm looking for something along the lines of php's "explode" function, but in mysql.


Thanks in advance for the help that anyone offers.

Help Needed Writing Query
I'm trying to make a query to return 10 sorted values, but I need to calculate the value to sort by, ie its not stored as a field in the table.
So say I had some data like this...

id basicrank time
1 5 40
2 7 33
3 3 55
etc.

I want to sort by (basicrank minus (currenttime - time)), so newer records get some priority, returning highest score first.
My query could then be something like this, given current time of 60.
SELECT id FROM table ORDER BY (basicrank-(60-time)) DESC LIMIT 10

Wordpress Database Help Needed!
I'm trying to import some content into the wp_posts database, which works, but I can't figure out how to make it automatically publish at a later date.

When I publish the imported content manually (eg. edit timestamp and hit publish) it works, but when I try and upload that into the database, it doesn't seem to register.

I'm doing some traveling soon and I don't want the blog to lay dormant! Here's my SQL for an example post:

Quote:

INSERT INTOwp_posts(ID,post_author,post_date,post_date_gmt,post_content,post_title,po st_category,post_excerpt,post_status,comment_status,ping_status,post_password, post_name,to_ping,pinged,post_modified,post_modified_gmt,post_content_filtered ,post_parent,guid,menu_order,post_type,post_mime_type,comment_count`) VALUES
(123, 1, &#55614;&#57159;-11-21 17:45:39', &#55614;&#57159;-11-21 23:31:15', 'I AM THE POST CONTENT', 'THIS IS THE POST TITLE', 19, '', 'future', 'open', 'open', '', 'this-is-the-post-slug', '', '', &#55614;&#57159;-12-01 17:45:39', &#55614;&#57159;-12-01 23:31:15', '', 0, '', 0, 'post', '', 0);`

So all times are set in the future, and the post_status is "future". Why is it not publishing when the time comes around?

Stored Procedure Needed
I have a table named players with these fields:

playerid {int}
teamid {int}
jersey {int}
playername {varchar(50)}
age {int}
And a table named pitchcounts with these fields:

id {int}
gamenum {int}
playerid {int}
pitchcount {int}
Now, what I need is a stored procedure to return the number of pitches each player pitched in a week where the weekno is passed
and the days rest required and next availability date of the pitcher based on the criteria below:

In-House Ages 13-16 (Babe Ruth)
--------------------------------------------------------
Pitches Days Rest
-------------------------------
0-20 0 Rest
21-40 1 Rest
41-60 2 Rest
61-95 3 Rest

********************************************************
In-House Ages 11 & 12 (Majors-American, National & Continental)
--------------------------------------------------------
Pitches Days Rest
-------------------------------
0-20 0 Rest
21-40 1 Rest
41-60 2 Rest
61-85 3 Rest
No more than 125 pitches in a week. 4 12's can pitch but no more than 240 pitches no matter how many games in a week.

********************************************************
Travel Ages 8, 9, 10, 11 & 12
--------------------------------------------------------
Player can pitch up to three innings in a weekend. Two innings doesn't affect In-House the next day, but prior In-House pitching does apply. If 61 or more pitches on Thurs or Sat no travel that weekend. A travel manager must obtain approval from the In-House manager in order to pitch a player for more than one inning if the in-house team has a game following the travel team on the same day. If pitchers does pitch more than 1 inning in travel, pitcher limited to 60 pitches In-House.
If travel follows In-House on same day, player can pitch in travel if no more than 60 pitches thrown in-house. These rules will be in place until may 1st. We want these rules to be followed in spirit as well as literally. If abuses are found, even if within rules, we will change them after may 1st. Under no circumstances is a player able to be made ineligible for In-House play.

********************************************************
In-House Ages 10 and 9'S in Majors (Majors American, National, Continental)
--------------------------------------------------------
Pitches Days Rest
-------------------------------
0-20 0 Rest
21-40 1 Rest
41-60 2 Rest
61-75 3 Rest
********************************************************
Double A In-House (AA)
--------------------------------------------------------
No more than 40 pitches in a game or 80 for a week.

********************************************************
Additional In-House Notes
--------------------------------------------------------
If a pitcher gets to 85 (75 at age 10) pitches in a game in the middle of a batter, they can finish the batter only. Pitching results must be reported by email to Director within 24 hours of the game by the winning manager. Pitcher can not re-enter to pitch in the same In-House game once removed from the mound. Pitcher receives seven warm-up pitches before their first inning on mound and five every inning thereafter. Warmup pitches no not count toward total counts. Pitches to final batter, if count gets past game or week totals, don't count toward totals. 12 year olds in Continental League can not pitch.

Rest Examples:

if 20 or less on Monday, available on Tuesday
if 21-40 on Monday, available on Wednesday
if 41-60 on Monday, available on Thursday
if 61 or more on Monday, available on Friday

Help Needed To Join Tables.....
I'm starting into mysql these days and I have some tables created

function_detail
+------------------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------------+------------------+------+-----+---------+----------------+
| function_id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| function_name | varchar(128) | NO | | | |
| function_description | varchar(512) | NO | | | |
| function_image | varchar(256) | NO | | | |
| function_image_caption | varchar(128) | NO | | | |
| function_extras | varchar(64) | NO | | | |
+------------------------+------------------+------+-----+---------+----------------+

option_detail
+----------------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+------------------+------+-----+---------+----------------+
| option_id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| option_name | varchar(64) | NO | | | |
| option_description | varchar(256) | NO | | | |
| option_image | varchar(256) | NO | | | |
| option_image_caption | varchar(128) | NO | | | |
| option_extras | varchar(64) | NO | | | |
+----------------------+------------------+------+-----+---------+----------------+

product_detail
+---------------------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default |Extra |
+---------------------------+------------------+------+-----+---------+----------------+
| product_id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| product_name | varchar(64) | NO | | | |
| product_short_description | varchar(256) | NO | | | |
| product_long_description | varchar(512) | NO | | | |
| product_series | varchar(64) | NO | | | |
| product_heads | varchar(64) | NO | | | |
| product_family | varchar(64) | NO | | | |
| product_category | varchar(64) | NO | | | |
| product_image | varchar(256) | NO | | | |
| product_image_caption | varchar(128) | NO | | | |
| product_catalog | varchar(512) | NO | | | |
| product_status | varchar(64) | NO | | | |
+---------------------------+------------------+------+-----+---------+----------------+

product_function_detail
+-------------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+------------------+------+-----+---------+-------+
| product_id | int(10) unsigned | NO | | 0 | |
| function_id | int(10) unsigned | NO | | | |
+-------------+------------------+------+-----+---------+-------+

product_option_detail
+-------------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+------------------+------+-----+---------+-------+
| product_id | int(10) unsigned | NO | PRI | 0 | |
| function_id | int(10) unsigned | NO | | | |
+-------------+------------------+------+-----+---------+-------+

product_technology_detail
+---------------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+------------------+------+-----+---------+-------+
| product_id | int(10) unsigned | NO | PRI | 0 | |
| technology_id | int(10) unsigned | NO | | | |
+---------------+------------------+------+-----+---------+-------+
these tables are meant for: (let's see if I can explain correctly)
Product Details would contain all the details for a certain products
Function Details would contain all the functions performed by these products.
Technology Detail would contain all the technology embeeded in these products.

Some products may have either the same technology or the same functions (with the same descriptions) but affirmatively not the same product details (description product name & etc).

For Instance
Product A would perform function a,b,c,d and e and would have technology X,Y and Z
product B would perform function f,g and h and would have technology W, Y and Z.
product C would perform function b,c and I and would have technology O,P,Q and X.

How can I link the three tables?
Meaning that product_detail ---> function_detail when the linkage between the two of them resides in product_function_detail?

Here is something I've tryied

SELECT function_id, product_id as producto FROM product_function_detail WHERE product_id = &#392;' ORDER BY function_id asc;

SELECT distinct function_name, function_description, function_detail.function_id
FROM (select function_id, product_id as producto from product_function_detail
WHERE product_id = &#392;' ORDER BY function_id asc)as xref, function_detail
WHERE producto=&#392;'
BUT so far, no luck.

SQL SELECT Statement Help Needed
I have three databases, like so:

1. Visitors: vid(int) | vname(varchar)
2. Events: eid(int) | ename(varchar)
3. Participation: pid(int) | visitor(int from vid) | event(int from eid)

The participation table is a criss cross reference table to associate visitors with events.

Given the vid(from visitor table) how go i query the database to get all the events a given visitor is participating in?

M2M Relational Query Help Needed
I have 3 tables, below are a list of the significant fields in each.

Stories
* story_id
* story_date

Editions
* edition_id
* publication_id

Story_Edition_Jct
* story_id
* edition_id

What I need to do is create a list of all the stories that are newer than 30 days and have not been assigned to a given publication_id, but may or may not have been assigned an edition.

Just to clear that up some more, a publication consists of many editions, so we're looking for stories that may have been published in other publications, but want to restrict them from being republished in a given publication.

The following query is what I've come up with:

MySQL Join Needed
I'm pretty new to MySQL and I don't really get the whole join thing, although I understand the theory behind it I have problems when putting it into practice. Basically I'm using PHP with MySQL back end and I've got two tables:

TEST
QUESTION

The primary key of Test is "testno" which is an auto_increment and question has "testno" as a foreign key, so I need a join that will insert the value of "testno" into question when ever a record is entered into TEST based on the "testname" which the user enters into a form.

Let me try and clarify:

$testname = $_POST['testname'];
sql="INSERT into question test.testno where testname = '$testname'";

Obviously this will not work but what I need in effect is a query which carries out this function.

Packing Needed For MySQL
I am still playing around with databases. So here it goes:

Is packing needed for MySQL (5.0)?

I have a new DB, which already is 178 MB. Will that continue to grow,
when I add and delete data? Does it reclaim freed space and deleted
rows?

If not, is there a (automated) way to pack tables using SQL or
something simple, which I can call from my app?

Select Statement Needed
The sending page allows the user to choose which search criteria he
wants, so this (and many other) pieces of the select statement may or
may not be present. The statement always starts with

SELECT * from logdata where driver = '$_COOKIE[username]'

If the user has selected them and supplied the proper data for a search,
other elements will be added to the query string. For example, it may
look like

SELECT * from logdata where driver = '$_COOKIE[username]' AND amount >=
$_POST[txtLowAmount] AND amount <= $_POST[txtHighAmount] AND restaurant
regexp???

I'm not even sure if that is where a regexp belongs or if that is how it
should be used.
Ultimately, I would prefer it be non case sensitive.
Here are some examples of what I want:

If the user string is "CHIL"
Chili'strue
Charlie'sfalse
CHILtrue
chfalse

Simple Code Needed
Just need a little code to transfer a user to a custom error page if connection to the database fails.
Like:
If(no connect){
header("location: error.php");
}

Just need the "no connect" part I guess.

Lemans Terms Needed
So can someone tell me in lemans terms what does LEFT JOIN do in MySQL? I see it more and more and have read the manuals but still don't understand. Maybe it's a mental block going on.

UPDATE / REPLACE - Assistance Needed
I have a table called COMPANY which holds 5,000 records
Fields: Company_ID (int:2), Name (varchar:100), State_2letter (varchar:2)
i.e. 1, ABC Company, AL
I have another table called STATE (51 records)
Fields: State_ID (int:2), State_2letter(varchar:2), State_Name (varchar:100)
i.e. 1, AL, Alabama
I want to change the structure of the COMPANY table to hold the STATE's table STATE_ID record to correspond with the State_2letter. But in the same time change the STATE_2letter to be an INT format too.
So, my COMPANY table will look like this...
i.e. 1, ABC Company, 1
I just cant find my solution on how to to an UPDATE command correctly.



Advice Needed On Database Schema
I am trying to come up with a proper database schema for this situation that's at least 3 NF. I'm just having trouble with a few of the associations.

First, here's the situation.

I want to store information about all the cards in a Tarot deck.

In the deck, there are two types of cards; namely the major and minor arcana.

Both of these have some common information I want to store, and I want to be able to choose just a random card, but they also have some data unique to each, and I also would like to choose a random card of a specific type.

For example, both types have an associated element. I will have an elements table probably with simply id and name, and perhaps an element_id in the main cards table.

Both also have an associated planet and zodiac sign. Most of the major arcana cards have either a planet or zodiac sign, but not both. Also the association is a little different. With the minor cards, the planet is a specific decanate within the sign. I guess that might not matter too much though in the storage of the data, though again it might if I wanted to retrieve the planets associated with the decanates of a sign.

Further, the major arcana have a specific Hebrew letter associated with each card, while the minor cards have no such associated letters.

Finally, each of the major arcana cards are classified as elemental, planetary, or zodiacal. The minor cards have no such classification.

So, how should I store these data? They are both cards, and have some common data, but both have very different data as well.


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