473,326 Members | 2,023 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,326 software developers and data experts.

easy question

I don't know SQL at all, but I have a problem now because I must use SQL in my PHP scripts.
So please help me!

I have 2 tables:
id | name
-----------
1 | thing1
2 | thing2
3 | thing3
4 | thing4

id1 | id2
--------
1 | 1
1 | 2
1 | 3
1 | 4
2 | 1
2 | 2
.......

from second table, with which SQL query I will take this table:
thing1 | thing1
thing1 | thing2
thing1 | thing3
thing1 | thing4
thing2 | thing1
.....
????

Second question:
Until now, instead of databases I was use many INI files.
All work great with both of 2 cases but in case of INI files, changes are very easy.
Is there an easy tool for edit databases?

I use MySQL

thanks for your response
Jul 19 '05 #1
2 1545
<- Chameleon -> wrote:
I don't know SQL at all, but I have a problem now because I must use SQL in my PHP scripts.
So please help me!

I have 2 tables:
id | name
-----------
1 | thing1
2 | thing2
3 | thing3
4 | thing4

id1 | id2
--------
1 | 1
1 | 2
1 | 3
1 | 4
2 | 1
2 | 2
......

from second table, with which SQL query I will take this table:
thing1 | thing1
thing1 | thing2
thing1 | thing3
thing1 | thing4
thing2 | thing1
....
????

Second question:
Until now, instead of databases I was use many INI files.
All work great with both of 2 cases but in case of INI files, changes are very easy.
Is there an easy tool for edit databases?

I use MySQL

thanks for your response

Assuming t1 is your id|name table and t2 is your id1|id2 table,
something like (untested)

SELECT t1.name,t3.name FROM t2 LEFT JOIN t1 ON t2.id1=t1.id LEFT JOIN t1
AS t3 ON t2.id1=t3.id

Jul 19 '05 #2
<- Chameleon -> wrote:
I don't know SQL at all, but I have a problem now because I must use SQL in my PHP scripts.
So please help me!

I have 2 tables:
id | name
-----------
1 | thing1
2 | thing2
3 | thing3
4 | thing4

id1 | id2
--------
1 | 1
1 | 2
1 | 3
1 | 4
2 | 1
2 | 2
......

from second table, with which SQL query I will take this table:
thing1 | thing1
thing1 | thing2
thing1 | thing3
thing1 | thing4
thing2 | thing1
....
????

Second question:
Until now, instead of databases I was use many INI files.
All work great with both of 2 cases but in case of INI files, changes are very easy.
Is there an easy tool for edit databases?

I use MySQL

thanks for your response

Assuming t1 is your id|name table and t2 is your id1|id2 table,
something like (untested)

SELECT t1.name,t3.name FROM t2 LEFT JOIN t1 ON t2.id1=t1.id LEFT JOIN t1
AS t3 ON t2.id1=t3.id

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rdsteph | last post by:
I am having a lot of fun using the pyGoogle module ( http://pygoogle.sourceforge.net/ ) that uses the Google API. It is about as easy to use as I can imagine, and it is a lot nicer than using my...
0
by: | last post by:
I don't know SQL at all, but I have a problem now because I must use SQL in my PHP scripts. So please help me! I have 2 tables: id | name ----------- 1 | thing1 2 | thing2 3 | thing3 4 ...
5
by: LedZep | last post by:
What up, All I need to do is enter a last name in a text box, query a MSAccess database and display the name with the corresponding columns. This is no problem, but when there are more than one...
1
by: Mad Scientist Jr | last post by:
can someone explain how to simply populate a grid in .net ? the way i understand it, there is no more msflexgrid, and instead is this new control that has to be tied to a dataset, and it is a real...
13
by: Ghislain Tanguay | last post by:
I have a compiled vb.net app and I want to give the user a choice to launch it from the start line command and pass it a parameter or not. How can I do that in my code? Is it possible? Ex. :...
1
by: melanieab | last post by:
Hi, If there's a textbox and the text entered is longer than what's visible (the textbox length), how do you make it so that the beginning chunk of text is visible (instead of the last part of...
23
by: **Developer** | last post by:
Is there an easy way to copies all files in a directory into another directory? What about coping subdirectories too? Thanks in advance for any info
6
by: Martin Bootsma | last post by:
I have a C question, which looks very easy, but no one here seems to know an easy answer. I have a function "powell" (from Numerical Recipes) which takes an argument of the type "double...
27
by: smnoff | last post by:
How does( or should user use) strncpy() to allocate enough memory space for the destination string, s1? I guess I am having trouble using strncpy as it seems to be giving me errors. And just...
9
by: rynTAU | last post by:
This is an easy question, I'm sure but I can't seem to figure it out. I'm trying to use the number_format() function to remove all decimal places from a number. $num = number_format($num,...
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.