WebWork Magazin - Webseiten erstellen lassen, Online Medien, html

Webhoster, Webhosting Provider und Domain registrieren

Home | Registrieren | Einloggen | Suchen | Aktuelles | GSL-Webservice | Suleitec Webhosting
Reparatur-Forum | Elektro forum | Ersatzteilshop Haushalt und Elektronik


Homepage und Webhosting-Forum

Scripte und Programme für PHP, MYSQL. Diskussionen zur Programmierung im Web. Fragen zu CMS, Blogsoftware, Shops, Newsletter und vielen weiteren Scripten.


Forum » PHP & MySQL » News-script » Antworten
Benutzername:
Passwort: Passwort vergessen?
Inhalt der Nachricht: Fett | Kursiv | Unterstrichen | Link | Bild | Smiley | Zitat | Zentriert | Quellcode| Kleiner Text
Optionen: Emailbenachrichtigung bei Antworten
 

Die letzten 5 Postings in diesem Thema » Alle anzeigen
von Maxx
nein das musst du vor der ausgabe des "NewsTeiles" einfügen,
d.h. befor die news ausgegeben werden
von ketchxup
mal ne blööde Frage wo sollte ich es am besten einbauen
oder muss ich es mit etwas ersetzen
von Maxx
wenn die ohne news nicht angezeigt werden mach eine abfrage:

1: 
2: 
3: 
4: 
5: 
6:
if($mysql_num_rows($newspl) == "0"){
  echo 'keine News vorhanden';
  // und dann ggf. noch ein exit();
}
von ketchxup

Danke hat mir viel geholfen !!!!!!!!!

nun möchte ich die news in meinem Spielerprofil einbinden
genau so wie hier (ganz unten) Jens Lehman Profil

tabelle1(Spielerprofil)

profil-> id,title,text,born ...usw

tabelle2(news)
news:-> id,title,datum,beitrag,profid,katid


ich möchte einfach die news im Profil (profil.php) wo alle Spieler aufgelistet sind
einbinden.

e.g Latest News from "SpielerX" und das nämlich bei allen

hab mit "FROM news INNER JOIN profil ON news.profid = profil.id"
zwar ging es aber spieler ohne news werden nicht angezeigt und alles wiederholt sich.


so sieht die quelle aus!

profi.php

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: 
25: 
26: 
27: 
28: 
29: 
30: 
31: 
32: 
33: 
34: 
35: 
36: 
37: 
38: 
39: 
40: 
41: 
42: 
43: 
44: 
45: 
46: 
47: 
48: 
49: 
50: 
51: 
52: 
53: 
54: 
55: 
56: 
57: 
58: 
59: 
60: 
61: 
62: 
63: 
64: 
65: 
66: 
67: 
68: 
69: 
70: 
71: 
72: 
73: 
74: 
75: 
76: 
77: 
78: 
79: 
80: 
81: 
82: 
83: 
84: 
85: 
86: 
87: 
88: 
89: 
90: 
91: 
92: 
93: 
94: 
95: 
96: 
97: 
98: 
99: 
100: 
101: 
102: 
103: 
104: 
105: 
106: 
107: 
108: 
109: 
110: 
111: 
112: 
113: 
114: 
115: 
116: 
117: 
118: 
119: 
120: 
121: 
122: 
123: 
124: 
125: 
126: 
127: 
128: 
129: 
130: 
131: 
132: 
133: 
134: 
135: 
136: 
137: 
138: 
139: 
140: 
141: 
142: 
143: 
144: 
145: 
146: 
147: 
148: 
149: 
150: 
151: 
152: 
153: 
154: 
155: 
156: 
157: 
158: 
159: 
160: 
161: 
162: 
163: 
164: 
165: 
166: 
167: 
168: 
169: 
170: 
171: 
172: 
173: 
174: 
175: 
176: 
177: 
178: 
179: 
180: 
181: 
182: 
183: 
184: 
185: 
186: 
187: 
188: 
189: 
190: 
191: 
192: 
193: 
194: 
195:
<?
include("./config.php");//include the file to connect to the database
//kategorien mysql//********************************************************
$query_kat = "SELECT * FROM kategorien";                                  // 
$kat2 = mysql_query($query_kat) or die(mysql_error());                    //
$row_kat2 = mysql_fetch_assoc($kat2);                                     //
//***************************************************************************


//player profil mysql//********************************************************
$query_art = "SELECT * FROM profil"; 
$art = mysql_query($query_art) or die(mysql_error());                    //
$row_art = mysql_fetch_assoc($art);                                     //
//***************************************************************************



//player lsit/menu mysql//********************************************************
$query_dd = "SELECT * FROM profil"; 
$dd = mysql_query($query_dd) or die(mysql_error());                    //
$row_dd = mysql_fetch_assoc($dd);                                     //
//***************************************************************************

genau hier ist das problem

//player News mysql//********************************************************
$query_newspl = "SELECT * FROM news"; 
$newspl= mysql_query($query_newspl) or die(mysql_error());                    //
$row_newspl = mysql_fetch_assoc($newspl);                                     //
//***************************************************************************



?>
<html>
<head>
<link href="css/style01.css" rel="stylesheet" type="text/css">
</head>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>



 



<body>
  
 <!-- Profil Scoll -->
   <form>
   <select name="staff_js" class="listmenu" onChange="goto_URL(this.form.staff_js)">
   <option value="">-- Please select --</option>
   <?php do {  ?>
  <option value="topic.php?id_art=<?php echo $row_dd['id_art']; ?>"><?php echo $row_dd['title_art']?>
  </option>
    <?php
} while ($row_dd = mysql_fetch_assoc($dd));
  $rows = mysql_num_rows($dd);
  if($rows > 0) {
      mysql_data_seek($dd, 0);
	  $row_dd = mysql_fetch_assoc($dd);
  }
?>
    </select></form>
  	
  <?php do { ?>
 
  <table width="745" height="392"  border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" >
  <!--DWLayoutTable-->
  <tr> 
    <td width="5" height="22"> </td>
    <td colspan="2" rowspan="3" valign="top"><table width="100" border="0" cellpadding="0" cellspacing="0" class="tb">
        <!--DWLayoutTable-->
        <tr> 
          <td width="64" height="95"> </td>
          <td width="64" valign="top"><img src="<?php echo $row_art['img']; ?>"></td>
        </tr>
      </table></td>
    <td width="36"> </td>
    <td width="450"> </td>
    <td width="1"></td>
    <td width="23"></td>
  </tr>
  <tr> 
    <td height="43"> </td>
    <td> </td>
    <td colspan="2" valign="top" class="tb"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="tb">
        <!--DWLayoutTable-->
        <tr> 
          <td width="284" height="7"></td>
          <td width="65"></td>
          <td width="102"></td>
        </tr>
        <tr> 
          <td height="10"></td>
          <td rowspan="2" valign="top" class="title"><img src=" <?php echo $row_art['trickot']; ?>" width="36" height="29"  id="trickot"></td>
          <td></td>
        </tr>
        <tr> 
          <td height="20" valign="top" class="title"><a href="topic.php?id_art=<?php echo $row_art['id_art']; ?>"   id="arttile" dir="arttile"><?php echo $row_art['title_art']; ?></a></td>
          <td></td>
        </tr>
      </table></td>
    <td> </td>
  </tr>
  <tr> 
    <td height="30"></td>
    <td> </td>
    <td colspan="2" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="tb">
        <!--DWLayoutTable-->
        <tr> 
          <td width="100%" height="28" valign="top" class="textcont"><p><?php echo $row_art['description_art']; ?><a   id="aprofil" href="../../Templates/topic.php?id_art=<?php echo $row_art['id_art']; ?>"> 
              </a></p></td>
          <td width="1" rowspan="2"> </td>
          <td width="1" rowspan="2"></td>
        </tr>
        <tr> 
          <td height="29" valign="top" class="textcont"><?php echo $row_art['title']; ?>
		 
		  </td>
        </tr>
        <tr> 
          <td height="116" valign="top" class="playerlink" ></td>
          <td valign="top" class="playerlink" ></td>
          <td></td>
        </tr>
        <tr> 
          <td height="1"></td>
          <td><img src="../../spacer.gif" alt="" width="1" height="1"></td>
          <td><img src="../../spacer.gif" alt="" width="1" height="1"></td>
        </tr>
      </table></td>
    <td></td>
  </tr>
  <tr> 
    <td height="109"></td>
    <td width="203" rowspan="2" valign="top" class="profil"><p></p>
      <p><span class="proftext1"> Name:</span><span class="proftext2"> <?php echo $row_art['full_name']; ?></span>

        <span class="proftext1">Born:</span><span class="proftext2"> <?php echo $row_art['Born']; ?></span>

        <span class="proftext1">Position</span><span class="proftext2">: <?php echo $row_art['Position']; ?></span>

        <span class="proftext1">Appearence:</span> <span class="proftext2"><?php echo $row_art['appearences']; ?></span>

        <span class="proftext1">Minutes Played:</span><span class="proftext2"> 
        <?php echo $row_art['minutes_played']; ?></span>

        <span class="proftext1">Joined Arsenal:</span> <span class="proftext2"><?php echo $row_art['joined_arsenal']; ?></span>

        <span class="proftext1">Previous Club(s):</span><span class="proftext2"><?php echo $row_art['previous_club(s)']; ?>

        </span></p>
      <p><a href="topic.php?id_art=<?php echo $row_art['id_art']; ?>" class="playerlink">Full 
        Profil</a><img src=" <?php echo $row_art['trickot']; ?>" width="36" height="19" id="abild"> 
      </p></td>
    <td width="27" rowspan="2" valign="top" class="profbar"><!--DWLayoutEmptyCell--> </td>
  </tr>
  <tr> 
    <td height="2"></td>
    <td></td>
    <td rowspan="3"> </td>
    <td></td>
    <td></td>
  </tr>
  <tr> 
    <td height="40"></td>
  </tr>
</table>
 <?php } while ($row_art = mysql_fetch_assoc($art)); ?>

 
 
 </body>
</html>
</SCRIPT> 
<script language="JavaScript">
		function goto_URL(object)
		{
			window.location.href = object.options[object.selectedIndex].value;
		}
</script>



<?php mysql_free_result($art);?>



P.s diese auf und zu gemache..: ich wüsste einfach nicht wie es anders gehen sollte da ich html-tags benutze.....
von Maxx
kann das sein das deine Datenbank leer is um mal dumm zu fragen??
wenn nein dann versuch mal so:

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10:
<?  include("config.php");

 $query_kat = "SELECT * FROM kategorien"; 
 $kat2 = mysql_query($query_kat) or die(mysql_error()); 
 $row_kat2 = mysql_fetch_assoc($kat2);       
 
 echo '<a href="viewnews.php?kadid"'.$row_kat2['id'].'">LINK</a>';
 ?>       


PS DEIN CODE IS SOWAS VON DUMM ZUSAMMENGESTELLT!!!!
das is 100% unübersichtlich und was soll immer das php auf und zu gemache??
nimm echo oder sowas ...

Nach oben