Prima pagină
 
Tutoriale web
Un mic ghid de programare web
 
.
Vizualizare mesaje fără răspuns | Vizualizare subiecte active Acum este Joi Sep 09, 2010 3:15 am



Scrie un subiect nou Răspunde la subiect  [ 6 mesaje ] 
 Problema MySQL 
Autor Mesaj
Vizitator
Vizitator

Membru din: Mie Iun 30, 2010 8:36 pm
Mesaje: 11
Mesaj Problema MySQL
Salutare. Am 2 tabele intr-o baza de date: unul pentru scoruri si unul pentru jucatori.

Scoruri
-> id
-> echipa 1
-> echipa 2
-> scor echipa 1
-> scor echipa 2

Jucatori
-> id
-> nume
-> echipa

Mi se cere sa iau cei 5 jucatori care au cele mai multe meciuri castigate. Eu am incercat sa iau echipele care au castigat folosind: SELECT * FROM scoruri WHERE scor echipa 1 > scor echipa 2 si invers (am facut 2 query-uri) si apoi sa vad care jucator se incadreaza dar nu mi-a iesit de nicio culoare.

Aveti alte idei?


Mie Iun 30, 2010 9:08 pm
Profil E-mail
Asta vorbeste mult
Asta vorbeste mult

Membru din: Mie Ian 14, 2009 5:55 pm
Mesaje: 199
Localitate: Ploiesti
Mesaj Re: Problema MySQL
pai tu ai asa daca am inteles bine ( modificate un pic pe intelesul meu):

Cod:
// COMMENT: Teams Table
`team_id`;
`team`;
// HINT: adaugi:
`team_total_wins`;

// COMMENT: Match Tables
`match_id`;
`team_id`;
`match_date`;
`team_score_one`;
`team_score_two`;

// COMMENT: Players Table
`player_id`;
`team_id`;
`player_name;

well eu ceva de genul as face.. acum depinde de multe nu iti stiu toate datele proiectului dar
din ce mi-ai explicat.. cam asa ar veni

_________________
“When debugging, novices insert corrective code; experts remove defective code.”
– Richard Pattis


Mie Iun 30, 2010 11:22 pm
Profil E-mail YIM
Vizitator
Vizitator

Membru din: Mie Iun 30, 2010 8:36 pm
Mesaje: 11
Mesaj Re: Problema MySQL
Cineva mi-a recomandat sa folosesc array 2D, dar cred c-o sa creez o coloana noua pana la urma :)


Joi Iul 01, 2010 8:47 am
Profil E-mail
Asta vorbeste mult
Asta vorbeste mult

Membru din: Mie Ian 14, 2009 5:55 pm
Mesaje: 199
Localitate: Ploiesti
Mesaj Re: Problema MySQL
array 2D :D? cum mai e si ala:D?

_________________
“When debugging, novices insert corrective code; experts remove defective code.”
– Richard Pattis


Joi Iul 01, 2010 10:54 pm
Profil E-mail YIM
Vizitator
Vizitator

Membru din: Mie Iun 30, 2010 8:36 pm
Mesaje: 11
Mesaj Re: Problema MySQL
Adica sa extrag datele astfel incat sa-mi dea un array $jucator[$id][$castig]


Vin Iul 02, 2010 8:48 am
Profil E-mail
Asta vorbeste mult
Asta vorbeste mult

Membru din: Mie Ian 14, 2009 5:55 pm
Mesaje: 199
Localitate: Ploiesti
Mesaj Re: Problema MySQL
se numeste array multidimensional ..Arrays.
Citat:
An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier.
That means that, for example, we can store 5 values of type int in an array without having to declare 5 different variables, each one with a different identifier. Instead of that, using an array we can store 5 different values of the same type, int for example, with a unique identifier.



Citat:
Multidimensional arrays


Multidimensional arrays can be described as "arrays of arrays". For example, a bidimensional array can be imagined as a bidimensional table made of elements, all of them of a same uniform data type.



Adica un array intr-un array
Cod:
$array = array(
   'elements_array' => array(
        'first_element' => 'first_element_value',
        'second_element' => 'second_element_value',
   ),

    'planets_array' => array(
        'Earth' => 'Home World',
        'Pluto' => 'second-largest known dwarf planet'
    ),
    'my_name?' => 'Bogdan',
);


_________________
“When debugging, novices insert corrective code; experts remove defective code.”
– Richard Pattis


Dum Iul 04, 2010 11:44 am
Profil E-mail YIM
Afişează mesajele de la anteriorul:  Sortează după  
Scrie un subiect nou Răspunde la subiect  [ 6 mesaje ] 


Cine este conectat

Utilizatorii ce navighează pe acest forum: Niciun utilizator înregistrat şi 1 vizitator


Nu puteţi scrie subiecte noi în acest forum
Nu puteţi răspunde subiectelor din acest forum
Nu puteţi modifica mesajele dumneavoastră în acest forum
Nu puteţi şterge mesajele dumneavoastră în acest forum

Căutare după:
Mergi la:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.
Translation/Traducere: phpBB România