English
PHP, HTML & JavaScript- Forum

data with php from MySQL data base choose

 
- Page 1 -



Pocowast
my scheduler in the data base has 5 Split: id - cover - timestamp - Text - linkto

now should me php from the slot "titel" any cover heraussuchen, The with "A" begin and among themselves spend, means
1.row "titel x"
2.row "text x"
3.row "titel y"
4.row "text y" etc.

<?php
$_db_host = "localhost";
$_db_username = "username";
$_db_passwort = "passwort";
$_db_datenbank = "datenbank";

# link to data base produce
$_link = mysql_connect($_db_host, $_db_username, $_db_passwort);

# Verify whether The link worked has
if (!$_link)
{
# No, So the whole Skript Cancel !
The("Keine link to data base possible: " .
mysql_error());
}

# link has worked, moreover ...
echo "Verbindung to data base successful.<br>";

# data base select
mysql_select_db($_db_datenbank, $_link);

so far be I now!

who can me moreover help? Opportunities yet nice holidays. LGvP
 
12/25/11  
 



 
- Page 1 -



Pocowast
Hello IF,
go time Please to there:  [...] 
and look you whom Seitenquelltext on. as expert see You sure same, what can make, so in of my scheduler the image or. The Images To see are. the should in the view time so similar his, How my jetziger >>>  [...] 
LGvP
 
12/27/11  
 



Müsstest only (How already written) stripslashes on The spending utilize -

quasi instead of echo $stuff just echo stripslashes($stuff)
 
12/27/11  
 




Pocowast
Hi, with the strippen I had already probiert - went always not. now have I times the clinging and Semikolons aufgeräumt, now goes it. thanks. with the Reading be I so far pleased. as nächstes wished I, each cover as link present. if I there again Help need, should I one new Topic make or here moreover write?
LGvP
 
12/27/11  
 



gladly happen.

New-Topic or not-new-Topic simply self decide whether it hold z.B. of Topictitle since yet fit and the old Topic on "erledigt" settle.
 
12/27/11  
 




Pocowast
So I have a list run, with all names, The with B begin and same whom dazugehörenden Text with Show let. there it with the Time yet plenty More Entries give becomes, is these manner the display not meaningfully and it would To many pages go. instead I will now a list with the Titeln abrufen and the have I already ready >>>  [...] 
How can I the echo now procure, that the cover each as link displayed and is if the then functions, what must I yet for statement preparing (if I then on so a finished link click)? have already gegoogelt, but something like in this direction wasn't thereby. Perhaps have your too a german link for my think about. I learn gladly moreover. LGvP
 
12/27/11  
 



well instead of echo $cover."<br>" simply echo "<a href='#'>".$cover."</a><br>" and already are it "Links" -

The lead then but first only moreover to that Page header To navigating.

means instead of href='#' something like How href='?showitem=".$id."'

and the php then $showitem=intval($_GET['showitem']) on the head and the Loop something like How if ($id==$showitem) echo "gewählter entry!"
 
12/27/11  
 



 
- Page 2 -



Pocowast
so! the
>>> echo "<a href=\"".$filename."?showid=".$row['id'].">".$data["titel"]."</a><br><hr>";<<<
have I now made and can any left see. <<< only moreover come I do not! mandatory with the §showitem and the Loop in a new File made go or in this here? LGvP
 
12/28/11  
 



whether new file or same File entscheidest simply of drop To drop -

hierbei vlt. simply in the same File in the Loop The now already already any Entries listet then More Information to a entry Show if this even klicked watts. the against can You detect in the You the value the übergebenen variables by $_['GET'] ermittelst after You the value by Get übermittelt have z.B. by: http: // Page.tld / script.ext ? bla=5 where then
echo $_GET["bla"]

5

spend would.
 
12/28/11  
 




Pocowast
I faith, that I now on my border stoße! this is, as would You one Blinden the write procure want! so see it from and goes now not any more!

$link = mysql_connect($server, $username, $Password);
if (!$link) The(mysql_error());

$db = mysql_select_db($data base, $link);

if ($db)
{
$re = mysql_query("SELECT cover FROM 01_lexikon ORDER BY titel", $link);

while($data = mysql_fetch_array($re, MYSQL_ASSOC))
{
echo "<a href=\"".$filename."?showid=".$row['id'].">".$data["titel"]."</a><br><hr>";
}

$showitem=intval($_GET["showitem"]);

if ($id==$showitem)
while($_GET=§showitem)
{
echo $_GET["showitem"];
}
?>
Parse error: syntax error, unexpected $end in /var/w....... Lach now not over so much showitem, but You come certainly too still in my old, where You simply überfordert are. LGvP
 
12/28/11  
 



Hello IF,
have today whom whole day rumgebastelt. others phpForen visit, but It's all right not. I wanted to it in a File leave. it functions To to Link-list but to the Click on irgendeinen Link does itself nothing. If you you freundlicherweise again my code look at could: >>>
$link = mysql_connect($server, $username, $Password);
if (!$link) The(mysql_error());

$db = mysql_select_db($data base, $link);

if ($db)

$re = mysql_query("SELECT * FROM 01_lexikon ORDER BY titel", $link);

while($data = mysql_fetch_array($re, MYSQL_ASSOC))

echo "<li><a href='?showitem=".$data['id'].">".$data["titel"]."</a><br><hr>"
;

$showitem=intval($_GET['showitem']);

if ($id==$showitem)

echo $_GET[".$data."];

where is the Error?
 
12/29/11  
 



what You want is integrally simply -

but Please gib still Source with View source-Tags on.

I must now unfortunately in that bed but once I one eye draufwerfen could give I you naturally message.
 
12/30/11  
 



Regards!

If you ohnehin already subesquent code have:
while($data = mysql_fetch_array($re, MYSQL_ASSOC))
echo "<li><a href='?showitem=".$data['id'].">".$data["titel"]."</a><br><hr>"

then füge this before it one:
;$showitem=""
;if ($_GET["showitem"]=="")
;else $showitem=intval($_GET["showitem"])
;

and then instead of your Loop:
;while($data = mysql_fetch_array($re, MYSQL_ASSOC)){

    ;echo "<li><a href='?showitem=".$data['id']."'>".$data["titel"]."</a><br>"

    ;if ($data["id"]===$showitem) {

        ;echo "Treffer!"

    ;}

    ;echo "<hr>"

;}

;
 
01/05/12  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

28.116 Views

Untitledvor 0 min.
Peter Max Müller vor 16 Tagen
H.Brill01/21/24
Erasmus.Herold01/07/23
Member 834194508/26/21
More...

Themeninformationen

this Topic has 3 subscriber:

iF (9x)
Pocowast (8x)
unbekannt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie