Jump to content
php.lv forumi

Palīdziet ar infas izvilkšanu no DB


krisis32

Recommended Posts

Pasaku jau iepreikš: No DB saprotu tikpat daudz cik no Ķīniešu valodas!

 

Datubāzē man ir koamandas:

 

ID:1 REZ|UTT|KOMANDA

ID:1 REZ|UTT|KOMANDA2

 

Man vaig kaut kā uztaisīt, lai izvelk tikai KOMANDA spēles, un tās kuras ir tajā pašā ID.

 

Pats šitik tālu esmu ticis:

 

<?php
$con = mysql_connect("localhost","DB_USERNAME","DB_PAROLE");
if (!$con)
 {
 die('Could not connect: ' . mysql_error());
 }

mysql_select_db("DB", $con);

$result = mysql_query("SELECT * FROM ------ where id in (1) and team = 'KOMANDA'");

echo "<table border='1'>
<tr>
<th>Komanda</th>
<th>Rezultāts</th>
<th>Metieni</th>
</tr>";

while($row = mysql_fetch_array($result))
 {
 echo "<tr>";
 echo "<td>" . $row['team'] . "</td>";
 echo "<td>" . $row['rez'] . "</td>";
 echo "<td>" . $row['Shoot'] . "</td>";
 echo "</tr>";
 }
echo "</table>";

mysql_close($con);
?>

 

Man viņš izvelk tikai KOMANDAS infu. Ja lieku noteiktu ID, tad izvelk tikai to ID!

Kā jau minēju no DB ļoti maz saprotu!

 

Paldies jau iepriekš!

Link to comment
Share on other sites

Nu ja, bet kaa lai uztaisa lai izvelk tikai KOMANDAS speeles?!?

 

nevis ID1 un pēctam tikai KOMANDAS REZ utt

 

Ar to OR man nekas nemainijaas!

 

Jo KOMANDAS vs KOMANDA2 ir viens ID nevis katram savs!

 

Un man vaig izvilkt tos konkreetos ID kur ir KOMANDAS speeles pret kaadu citu KOMANDU

Edited by krisis32
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...