09. oktober 2003 - 00:08
Der er
46 kommentarer og 1 løsning
Blank side
Hvorfor får jeg en blank side med denne her kode? <? $database = mysql_connect("localhost","user","pass"); mysql_select_db("tabel"); $foresp = mysql_query("SELECT * FROM ero_tgpdata ORDER BY `id` DESC LIMIT 0,1"); while($data = mysql_fetch_array($foresp)){ $titel = $data["titel"]; $toplogo = $data["toplogo"]; $tgpdata = $data["tgpdata"]; $tgpdata2 = $data["tgpdata2"]; $tgpdata3 = $data["tgpdata3"]; $foresp2 = mysql_query("SELECT * FROM ero_index ORDER BY `id` DESC LIMIT 0,1"); while($data = mysql_fetch_array($foresp2)){ $titel = $data["titel"]; $toplogo = $data["toplogo"]; print" <head> <title>$titel</title> </head> <p align='center'> <img border='0' src='admin/upload/$toplogo'> <p align='center'> </p> <table width='100%' cellspacing cellpadding> <tr> <td width='33%'> <p align='center'></td> <td width='33%'> <p align='center'></td> <td width='34%'> <p align='center'></td> </tr> </table> <p> </p> <p> </p> <div align='center'> <center> <table width='90%' cellspacing cellpadding bordercolor='#000000' border='1'> <tr> <td width='100%' bgcolor='#666666'> <div align='center'> <center> <table border='0' width='70%' cellspacing='0' cellpadding='0'> <tr> <td width='100%'> <table border='1' width='100%' cellspacing='5' cellpadding='5' bgcolor='#808080' bordercolor='#000000'> <tr> <td width='20%' align='center'><img border='1' src='$tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='$tgpdata2' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='$tgpdata3' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> </tr> <tr> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> </tr> <tr> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> </tr> <tr> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> </tr> <tr> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> </tr> </table> </td> </tr> </table> </center> </div> </td> </tr> </table> </center> </div> " ?> <? } ?> <? } ?>
Annonceindlæg tema
Cloud & AI
I dette særtema ser vi på, hvordan cloud og AI bliver fundamentet for virksomhedernes digitale forretning, og hvordan de nye muligheder for automatisering og forretningsværdi kan udnyttes uden at miste overblik, sikkerhed og menneskelig kontrol.
09. oktober 2003 - 00:12
#1
prøv at lave `id` om til id hvis det bare er et helt tal.
09. oktober 2003 - 00:16
#2
stadig blank
09. oktober 2003 - 00:16
#3
Tilføj: or die(mysql_error()): $foresp = mysql_query("SELECT * FROM ero_tgpdata ORDER BY `id` DESC LIMIT 0,1") or die(mysql_error());
09. oktober 2003 - 00:17
#4
Og li'sådan med den anden forespørgsel: $foresp2 = mysql_query("SELECT * FROM ero_index ORDER BY `id` DESC LIMIT 0,1") or die(mysql_error());
09. oktober 2003 - 00:21
#5
2 sek
09. oktober 2003 - 00:24
#6
stadig blank
09. oktober 2003 - 00:27
#7
ogsp hvis du følger detox forslag kan du ev. linke til siden?
09. oktober 2003 - 00:27
#8
men det er os underligt det er kun en gang imellem den er helt blank
09. oktober 2003 - 00:27
#9
09. oktober 2003 - 00:27
#10
der er die funktion på nu
09. oktober 2003 - 00:29
#11
prøv denne her: $SQL = "SELECT * FROM ero_tgpdata ORDER BY id");" $foresp = mysql_query($sql); og så lave or die("Mysql Error:<br> " . mysql_error() . "<br><br>SQL:<br>" . $sql);
09. oktober 2003 - 00:30
#12
prøver
09. oktober 2003 - 00:32
#13
det kan den slet ikke
09. oktober 2003 - 00:37
#14
må sige jeg er blank :-), hvis du bare laver en alm. print "jeg er før sql" og print "jeg er efter sql" før og efter din sql kode hvad siger den så?
09. oktober 2003 - 00:38
#15
så siger den jeg er før er der en anden måde at hente oplysninger fra flere tabeler på? måske bryder den sig ikke om den der måde
09. oktober 2003 - 00:42
#16
ooOO nu har du vel noget i din database ?
09. oktober 2003 - 00:43
#17
Og din tabel hedder 'tabel'? Prøv lige at smide den på her osse: $database = mysql_connect("localhost","user","pass") or die(mysql_error()); mysql_select_db("tabel") or die(mysql_error());
09. oktober 2003 - 00:46
#18
den hedder ikke tabel men det retter jeg automatisk selv
09. oktober 2003 - 00:47
#19
stadig totalt blank
09. oktober 2003 - 00:49
#20
prøv at lave forkert login oplysninger først med mysql_connect("localho2st","user","pass") or die(mysql_error()); eller så med mysql_connect("localhost","use65r","pas56s") or die(mysql_error());
09. oktober 2003 - 00:50
#21
Warning: mysql_connect(): Unknown MySQL Server Host 'localhost2' (1) in /usr/local/psa/home/vhosts/gex.dk/httpdocs/erotgp/index.php on line 2 Unknown MySQL Server Host 'localhost2' (1)
09. oktober 2003 - 00:54
#22
Du mangler en ; til sidst efter den sidste " </tr> </table> </center> </div> "; ?>
09. oktober 2003 - 00:54
#23
men som jeg skrev at den kun nogen gange var blank. Jeg har en backup liggende jeg ved 100% virker. for da jeg tog den virkede det hele. Så smider jeg den op men den er stadig blank
09. oktober 2003 - 00:57
#24
Prøv med: <? $database = mysql_connect("localhost","user","pass"); mysql_select_db("tabel"); $foresp = mysql_query("SELECT * FROM ero_tgpdata ORDER BY `id` DESC LIMIT 0,1"); while($data = mysql_fetch_array($foresp)){ extract ($data); $foresp2 = mysql_query("SELECT * FROM ero_index ORDER BY `id` DESC LIMIT 0,1"); while($data = mysql_fetch_array($foresp2)){ extract ($data); print" <head> <title>$titel</title> </head> <p align='center'> <img border='0' src='admin/upload/$toplogo'> <p align='center'> </p> <table width='100%' cellspacing cellpadding> <tr> <td width='33%'> <p align='center'></td> <td width='33%'> <p align='center'></td> <td width='34%'> <p align='center'></td> </tr> </table> <p> </p> <p> </p> <div align='center'> <center> <table width='90%' cellspacing cellpadding bordercolor='#000000' border='1'> <tr> <td width='100%' bgcolor='#666666'> <div align='center'> <center> <table border='0' width='70%' cellspacing='0' cellpadding='0'> <tr> <td width='100%'> <table border='1' width='100%' cellspacing='5' cellpadding='5' bgcolor='#808080' bordercolor='#000000'> <tr> <td width='20%' align='center'><img border='1' src='$tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='$tgpdata2' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='$tgpdata3' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> </tr> <tr> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> </tr> <tr> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> </tr> <tr> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> </tr> <tr> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> </tr> </table> </td> </tr> </table> </center> </div> </td> </tr> </table> </center> </div> "; } } ?>
09. oktober 2003 - 00:58
#25
stadig blank
09. oktober 2003 - 01:02
#26
hmm WTF
09. oktober 2003 - 01:04
#27
Tjek lige: <?php trigger_error ("Fejl tjek", E_USER_ERROR); ?>
09. oktober 2003 - 01:08
#28
hvor skal den ind?
09. oktober 2003 - 01:08
#29
Giver den heller ikke noget?
09. oktober 2003 - 01:08
#30
Bare i en fil for sig.
09. oktober 2003 - 01:09
#31
smed den ind øverst og den skrev Fatal error: Fejl tjek in /usr/local/psa/home/vhosts/gex.dk/httpdocs/erotgp/index.php on line 2
09. oktober 2003 - 01:10
#32
Hmm, det burde da virke: <? $database = mysql_connect("localhost","user","pass") or die(mysql_error()); mysql_select_db("tabel") or die(mysql_error()); $foresp = mysql_query("SELECT * FROM ero_tgpdata ORDER BY `id` DESC LIMIT 0,1") or die(mysql_error()); while($data = mysql_fetch_array($foresp)){ extract ($data); $foresp2 = mysql_query("SELECT * FROM ero_index ORDER BY `id` DESC LIMIT 0,1") or die(mysql_error()); while($data = mysql_fetch_array($foresp2)){ extract ($data); print" <head> <title>$titel</title> </head> <p align='center'> <img border='0' src='admin/upload/$toplogo'> <p align='center'> </p> <table width='100%' cellspacing cellpadding> <tr> <td width='33%'> <p align='center'></td> <td width='33%'> <p align='center'></td> <td width='34%'> <p align='center'></td> </tr> </table> <p> </p> <p> </p> <div align='center'> <center> <table width='90%' cellspacing cellpadding bordercolor='#000000' border='1'> <tr> <td width='100%' bgcolor='#666666'> <div align='center'> <center> <table border='0' width='70%' cellspacing='0' cellpadding='0'> <tr> <td width='100%'> <table border='1' width='100%' cellspacing='5' cellpadding='5' bgcolor='#808080' bordercolor='#000000'> <tr> <td width='20%' align='center'><img border='1' src='$tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='$tgpdata2' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='$tgpdata3' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> </tr> <tr> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> </tr> <tr> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> </tr> <tr> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> </tr> <tr> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> <td width='20%' align='center'><img border='1' src='tgpdata' width='88' height='88'></td> </tr> </table> </td> </tr> </table> </center> </div> </td> </tr> </table> </center> </div> "; } } ?>
09. oktober 2003 - 01:11
#33
den skriver samme fejl ved en fil for sig selv
09. oktober 2003 - 01:12
#34
Ok, det virkede bare som om error_reporting var slået fra.
09. oktober 2003 - 01:14
#35
hvis du nu laver nedstående kontrol, kan du med sikkerhed slå fast om der overhovedet er kontakt med (den rigtige) database/tabel: $foresp = mysql_query("SELECT * FROM ero_tgpdata") $foresp2 = mysql_query("SELECT * FROM ero_index"); echo mysql_num_rows($foresp)." - ".mysql_num_rows($foresp2);
09. oktober 2003 - 01:21
#36
der er bare intet der virker nu
09. oktober 2003 - 01:21
#37
er der andre måder at hente oplysninger på
09. oktober 2003 - 01:23
#38
Du har da i det mindste en parse error på linie 5. Og hvad står der på linie 5?
09. oktober 2003 - 01:26
#39
$foresp2 = mysql_query("SELECT * FROM ero_index");
09. oktober 2003 - 01:30
#40
Det er fordi der mangler en ; i linie 4: $foresp = mysql_query("SELECT * FROM ero_tgpdata") $foresp2 = mysql_query("SELECT * FROM ero_index");
09. oktober 2003 - 01:31
#41
$foresp = mysql_query("SELECT * FROM ero_tgpdata"); $foresp2 = mysql_query("SELECT * FROM ero_index"); echo mysql_num_rows($foresp)." - ".mysql_num_rows($foresp2);
09. oktober 2003 - 01:33
#42
nej nej sådan står det allerede
09. oktober 2003 - 01:39
#43
Ja, så er den gal. For der er ingen parse errors i de 3 linier.
09. oktober 2003 - 01:44
#44
he nej det er totalt lamt
09. oktober 2003 - 10:28
#45
Jeg har oplevet samme problem, jeg skulle rette i et script for en kammi.. Fejlen fandt vi til sidst: <? if(/*If statement*/) { ?>Hej hej <!-- Noget HTML kode på samme linie som PHP'en--> Efter jeg rykkede Hej hej.. ned på næste linie virkede skidtet ! Har aldrig været ude for det før.. men det hjalp altså ! Så hvis du har noget BATCH nogen steder på din side, så sørg for at <? og ?> står på linier for sig selv, i hvertfald hvis det er if() sætninger !
09. oktober 2003 - 13:56
#46
hmm har fundet ud af at siden kun er blank hvis der er noget inde i mysqlen at hente. Hvis jeg tømmer alle tabelerne inde i min mysql bliver siden synligt. Men så snart jeg tilføjer noget igen, så bliver den totalt blank
10. oktober 2003 - 13:53
#47
Jeg lavede hele siden om så virkede det. Jeg kunne ikke gøre andet! Men ellers tak
Vi tilbyder markedets bedste kurser inden for webudvikling