![]() |
|
#1
|
|||
|
|||
cant find a sql/php query???Hi ,
Tables like this: table title blabla titelid, table rel_user_titel titelid userid usernr location table userid prename name And need following: to show the location, given the titelid i need a myasql command in for php. ...select from ... $result or somethin shoult contain prename, name and userid, Would be great to get something. Matthias ThX |
|
#2
|
||||
|
||||
|
Try this:
PHP Code:
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#3
|
|||
|
|||
Thank you, but a question remainsWhat do you mean with the letters?
t=title,l=location and what is "R"? How does this command with "as" works? Thanx Matthias |
|
#4
|
|||
|
|||
okI got it, I will test it
and then post again. matthias |
|
#5
|
|||
|
|||
|
He's created a query that joins the 2 tables together. Using the AS command, he gives each table a temporary name (R and L), to make it easy to refer to it's contents.
Try to sketch out what happens when the query is run. RETURN "prename", "name" and "userid" from the 'location' table (L). WHERE "title_id" of 'rel_user_titel' is a certain value AND "userid" of 'location' table = "userid" of 'rel_user_titel' table So it returns the rows of the 2 tables which have the same userid, and has a certain value in "title_id" of 'rel_user_titel' Hope this helps GF |
|
#6
|
|||
|
|||
I tried it but errors occuredI changed the code to this:
PHP Code:
Matthias |
|
#7
|
|||
|
|||
|
The entire SQL statement should be enclosed by a single pair of double quotes.
Read the error message. There's a string in an unexpected place. It's standing there on it's own, PHP doesn't realise it's part of the SQL. Change the line to exactly how Jay posted it. I see you played about with it, I'm not sure it's safe to call Standort: Standort. mySql may get confused since you're renaming the table with the same name. GF |
|
#8
|
|||
|
|||
OK, I#ve fixed itNo I need a short while or something construct to
"echo" the prename and the name. Matthias |
|
#9
|
|||
|
|||
Ive tried some thing, but..always only one name occurs, but i need a echo
like Location rename name;Thanx Matthias |
|
#10
|
||||
|
||||
PHP MySQL's while() loop exampletry this:
PHP Code:
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
Recent GIDBlog
2nd Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Where can I find web statistics script / software? | rhino1616 | Web Design Forum | 2 | 02-Jan-2004 20:31 |
| Integrate a mysql query into another | norok | MySQL / PHP Forum | 2 | 22-Jul-2003 06:25 |
| HELP!: find window width? Center a <div>? | Kingherc | Web Design Forum | 2 | 06-Jul-2003 05:25 |
| Search Engine Positioning 101 and 201 "How To" Tips... | 000 | Search Engine Optimization Forum | 0 | 29-May-2003 10:34 |
| How do I find the Unix log file route? | jrobbio | Web Hosting Forum | 4 | 04-Feb-2003 07:40 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The