473,320 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Use PHP to compare fields from two different tables in same database and yield result

I have a module in a shopping cart program where a sellers logs in and adds product. As usual the seller logs in with an email and password which is stored in the mysql table _supplier_admins. This table also contains the field supplier_admin_name.

When the seller adds product they currently have the choice to select a manufacturer. For later reporting reasons I am attempting to change the default manufacture depending on the seller logged in. The manufacturer is stored in the mysql table _manufactuers. It should be noted this same table also contains manufactuer_id and manufacture_name. I have created product manufactures in the cart that match each sellers_admin_ name.

It should also be noted that the cart that I am using uses the manufactuer_id to select, store, display and report on information not the manufacture_name.
As stated I am attempting to create code that will change the default manufacturer based on the seller that is logged in. Both of the fields that I want to compare are VARCHAR(32). I am not sure if this matters but one is of collation latin1_swedish_ci and the other is utf8_general_ci.

I want the code to do the following:

If the supplier_admin_name from table _supplier_adminsis equal to manufacture_name from table _manufactuers then the default manufacturer will be equal to the corresponding manufactuer_id. Corresponding meaning from the same record as the matching manufacture_name.

I know very little about php and I am hoping to get help with this. I am using the Zen Cart shopping cart software. MySQL client version: 5.0.45 and PHP Version 5.25

Any help with this code would be appreciated.

Thanks in advance, dbanrman.
Mar 26 '08 #1
1 2214
TheServant
1,168 Expert 1GB
If you want help with some code you have, you're in the right place. If you want someone to write some code for you, you need to go somewhere else. Assuming you have some code already, post it here and then tell us why it's not working or particular questions.

We don't make code, we fix code ;)

[Edit]
And use correct code tags in your post!
Mar 26 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Rachel Curran | last post by:
Please can anybody help me with the following: I have two separate excel spreadsheets that I have imported into access, each sheet holds the same fields. Both spreadsheets hold all information...
5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the...
2
by: Megan | last post by:
Hi everybody- I have 2 tables, Hearings and Rulings. Both have primary keys called, CaseID, that are autonumbers. I don't want both tables to have the same autonumber. For example, if Hearings...
1
by: Prakash RudraRaju | last post by:
Hi, I have recently migrated MSAccess Tables (nearly 120) to MySQL. To test successful migration I want to compare all tables. I have linked MySQL tables through ODBC connection. I want to...
8
by: Vincent | last post by:
has any one seen a program to compare mdbs'. I have ran into a few of them, but none seem to really do that job. Basically what I need to do is, take 2 access mdb's and check the differences...
9
by: VMI | last post by:
I have two tables and I want to compare these two tables with a query( ie. "select * from A where B.key = A.key") and the result will be stored in a 3rd table (table C). is this possible? If...
4
by: himanshupundir | last post by:
I have two identical tables, now I want to compare them and display the results in a form which looks something like this...CaseID is primary key and it is same for a case in both tables ...
5
by: Edd E | last post by:
Hi, I have a database to store my analyses (Access 2002, WinXp), the basic structure is: TABLE 1 = Sample Info TABLE 2 = Analysis type 1 TABLE 3 = Analysis type 2 TABLE 4 = Analysis type 3 ...
6
osward
by: osward | last post by:
Hi everyone, I have query(s) that I need to perform which I couldn't figure out, and following is the situation I have event table (which stores the event details) that has eid, date, time,...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.