Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL]Pobranie dwóch tabel
Hosiek
post
Post #1





Grupa: Zarejestrowani
Postów: 181
Pomógł: 0
Dołączył: 25.11.2010

Ostrzeżenie: (0%)
-----


A więc chodzi o to, mam zrobione "SELECT * FROM `pojazdy` WHERE WLASCICIEL=`test`) i pobiera i odczytuje w porządku, jednak jest tak ze mam dwa razy wlasciciela test, jednak z innymi wartosicami, jak moge pobrać oby dwa i zapisac to ?

Przykład, mam coś takiego

ID | WLASCICIEL | wartosc 1 | wartosc 2 | wartosc 3 |
1 | test | 56 | 16 | 513 |
2 | test | 25 | 67 | 54 |

wlasiciel jest tu i tu taki sam, jednak wartosci sie zmieniają, chce pobrac te i te wartosci, jest taka moziwosc ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Hosiek
post
Post #2





Grupa: Zarejestrowani
Postów: 181
Pomógł: 0
Dołączył: 25.11.2010

Ostrzeżenie: (0%)
-----


To jest do GTA IV, tam są funkcje ale do mysql działa to jak w c++, powinno działac to tak samo.

w puginie który instalowałem, czyli dodatkowy mysql są takie polecenia.
Kod
mysql_connect( string hostname, string username, string password, string database ) -- connects to a server
mysql_close( mysql_handler handler ) -- Closes a mysql-connection

mysql_escape_string( mysql_handler handler, string text ) -- escapes a string
* It's what you should do to ALL things you're inputting - such as
* "SELECT * FROM accounts WHERE username = '" + username + "' AND password = '" + password + "'"
* If anyone uses > '; DROP TABLE accounts; -- < as password, then the table is gone.

mysql_ping( mysql_handler handler ) -- returns true if you're still connected to the server
mysql_errno( mysql_handler handler ) -- returns the last error's number
mysql_error( mysql_handler handler ) -- returns the last error's text
mysql_query( mysql_handler handler, string query ) -- executes a query
mysql_free_result( mysql_result result ) -- free's a result (should do after you're done with each query)
mysql_fetch_assoc( mysql_result result ) -- returns a row from the result in associative, converting types automatically.
mysql_insert_id( mysql_handler handler ) -- returns the last insert id, obviously only useful with "INSERT INTO ..."
mysql_affected_rows( mysql_handler handler ) - returns the number of deleted/updated/whatever'd rows in the raw query


Ten post edytował Hosiek 23.01.2012, 21:56:51
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 13.10.2025 - 09:46