•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 375,172 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,109 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:
Views: 2162 | Replies: 2
![]() |
•
•
Join Date: May 2006
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
This is Abhishek. I am a newbie in PHP and we have to develop an Inventory management application. We have a MySQL database structure which looks like this (dissimilar)
VORTEX
Table 1: hardware
==========================================
hwid | total | manufacturer | hardware type | model no | specs | remarks|
==========================================
Table 2: assetserial
===========================================
assetid | serialnum | hwid
===========================================
Table 3: assetowner
============================================
assetid | username | locid
============================================
Table 4: userloc
=============================================
username | locid | country | city | site | cubicle |
=============================================
I have to implement search facility in this database wherein the user interface will just contain a text box wherein he types a string and fetch complete details from the database.
For eg: If someone searches for "abhishek" it must search for abhishek in all the tables and suppose it finds abhishek in the "userloc" table then it should be able to display abhishek's location from userloc, what assets abhishek possesses from assetowner, what are the serialnumbers of those assets fom assetserial and what are the hardware types of those assets (i.e. monitors/desktops/workstations...etc..) from the hardware table.
I dunno how to link the tables because they are dissimilar and also the fact that fields like username, locid,hwid etc are repeated in the 4 tables... so even if I actually search in each table it might find multiple instances of abhishek in userloc and assetowner....
Please help!!! Thanks in advance
Abhishek
This is Abhishek. I am a newbie in PHP and we have to develop an Inventory management application. We have a MySQL database structure which looks like this (dissimilar)
VORTEX
Table 1: hardware
==========================================
hwid | total | manufacturer | hardware type | model no | specs | remarks|
==========================================
Table 2: assetserial
===========================================
assetid | serialnum | hwid
===========================================
Table 3: assetowner
============================================
assetid | username | locid
============================================
Table 4: userloc
=============================================
username | locid | country | city | site | cubicle |
=============================================
I have to implement search facility in this database wherein the user interface will just contain a text box wherein he types a string and fetch complete details from the database.
For eg: If someone searches for "abhishek" it must search for abhishek in all the tables and suppose it finds abhishek in the "userloc" table then it should be able to display abhishek's location from userloc, what assets abhishek possesses from assetowner, what are the serialnumbers of those assets fom assetserial and what are the hardware types of those assets (i.e. monitors/desktops/workstations...etc..) from the hardware table.
I dunno how to link the tables because they are dissimilar and also the fact that fields like username, locid,hwid etc are repeated in the 4 tables... so even if I actually search in each table it might find multiple instances of abhishek in userloc and assetowner....
Please help!!! Thanks in advance
Abhishek
•
•
Join Date: May 2006
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
Originally Posted by campkev
it's will be verydifficult to search every field of every table for the input.
I suggest doing something like a drop down box with which fields to search and then a text box with what to search for. Then, you can setup your query based on the input.
When purchase order is placed, table 1 is only updated
When equipment is tagged and bonded the table 2 is updated
When eqpt is issued to user table 3 is updated
When location is reqd or there are internal moves then only table 4 is updated.
Keeping all this in view the database was designed.
Now the most probable options the end user might search for username and want to know his corresponding location, what assets he has, what are the serial numbers of these assets and the hardware type i.e. desktop, monitor etc...
can u give me some pointers on how to go a about implementing the dropdown scheme and how to populate dropdown... Is is good to write cases like first search in all four tables and then depending on results find in rest 3, then rest 2 and finally one...
Regards
Abhishek
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
adsense advertising blogging bomb book business coding community copyright css development div earth engine environment failure forum google html internet legal malware marketing mcafee microsoft monetization news operating pagerank phishing privacy publishing revenue search security silverlight software space spyware support symantec system tables technical universe video web webmaster wiki yahoo
- mysql search and display data help.... (MySQL)
- php drop down menu to search multiple sql tables (PHP)
- Help connecting to mysql tables (JSP)
- How to get continent->country->city data. (PHP)
- how to backup mysql DB to local machine? and restore? (MySQL)
Other Threads in the MySQL Forum
- Previous Thread: mysql < CSV < mydql
- Next Thread: innodb vs myisam


Linear Mode