Fejl på en side men ikke på en anden?
HejJeg har følgende problem. Jeg har en side hvor der er flere ting der kan ske alt efter hvad $sub er. Og hvis den står til ny eller andre så går det fint, men hvis det er manage så laver den fejl i et include som slet ikke høre dertil men bare er included med et galleri billede.
Her kommer fejlen.
Warning: Access denied for user: 'root@localhost' (Using password: NO) in /mail/web/jys0545/PRIVATDAGPLEJE-SG.DK/galleri_front.php on line 3
Warning: MySQL Connection Failed: Access denied for user: 'root@localhost' (Using password: NO) in /mail/web/jys0545/PRIVATDAGPLEJE-SG.DK/galleri_front.php on line 3
Warning: MySQL: A link to the server could not be established in /mail/web/jys0545/PRIVATDAGPLEJE-SG.DK/galleri_front.php on line 3
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /mail/web/jys0545/PRIVATDAGPLEJE-SG.DK/galleri_front.php on line 4
Er der nogen der kan se fejlen.
Her manage og new:
<?PHP
include_once ("auth.php"); ?>
<?php include_once ("../head.php");
include_once ("topTable.php");
$uD=mysql_query("SELECT user_id FROM marUser WHERE username='$_SESSION[user]'");
$usID = mysql_fetch_array($uD);
$user_id = $usID['user_id']; ?>
<table width="100%">
<tr>
<td width="80%">
<center>
<h3>Varer administration</h3>
</center>
<?php if (!isset($sub)){ ?>
<div class="NoteText">
Velkommen til opretning af varer på markedspladsen på privatdagpleje-sg.dk. hvis du vil tilføje en varer så
<a href="<?php echo $PHP_SELF; ?>?sub=new">tryk her</a><br />
<br />
<br />
</div>
<?php } ?>
<?php if ($sub=='manage'){ ?>
<table class="noteText" width="100%">
<tr>
<?php include_once ("../dacon.php");
$result=mysql_query("SELECT marProduct.*,marCat.* FROM marProduct INNER JOIN marCat ON (marProduct.cat_id = marCat.cat_id) WHERE user_id ='$user_id'") or die (mysql_error());
?>
<th width="60">Varer ID:</td><th width="200">Varer:</th><th width="70">Slet:</th>
</tr>
<tr>
<?php while ($row=mysql_fetch_array($result)){ ?>
<td><b><?php echo $row['product_id']; ?></b></td><td><?php echo $row['proName']; ?></td><td><a href="<?php echo $PHP_SELF; ?>?sub=delete&id=<?php echo $row['product_id']; ?>">Slet</a></td>
</tr>
<?php } ?>
</table>
<br />
<a href="<?php echo $PHP_SELF; ?>?sub=new">Tilføj en ny varer.</a>.
<br />
<br />
<br />
<?php
mysql_close($mysqlConnect);
?>
<?php } ?>
<!-- Type in the link information -->
<?php if ($sub=='new'){
?>
<table cellspacing="5" cellpadding="5">
<tr>
<td colspan="2" class="NoteText">Indtast Information i alle relevante celler.</td>
</tr>
<form action="<?php echo $PHP_SELF; ?>?sub=prodNew" enctype="multipart/form-data" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="15000">
<tr>
<td width="140" class="noteText"><b>Vare kategori:</b></td><td>
<?php include_once ("../dacon.php");
$result=mysql_query("SELECT * FROM marCat");
?>
<select name="cat_id">
<?php while ($resultat_1 = mysql_fetch_array($result)){ ?>
<option id="cat_id" value="<?php echo $resultat_1['cat_id']; ?>"><?php echo $resultat_1['category']; ?></option>
<?php } ?>
</select></td>
</tr>
<tr>
<td class="noteText"><b>Produkt navn:</b></td><td><input name="proName" size="40"></td>
</tr>
<tr>
<td class="noteText"><b>Produkt beskrivelse:</b></td><td><textarea name="Februar" cols="30" rows="10"></textarea></td>
</tr>
<tr>
<td class="noteText"><b>Billede 1:</b><br />Max Størrelse. 15kb</td><td><input name="picture_1" size="30" type="file"></td>
</tr>
<tr>
<td class="noteText"><b>Billede 2:</b><br />Max Størrelse. 15kb</td><td><input name="picture_2" size="30" type="file"></td>
</tr>
<tr>
<td class="noteText"><b>Pris:</b></td><td><input name="proPrice" size="15"></td>
</tr>
<tr>
<td class="noteText"><b>Annonce type:</b></td><td><select name="type"><option value="1">Salg</option><option value="2">Køb</option><option value="3">Bytte</option></select></td>
</tr>
<tr>
<td class="noteText"><b>Løbetid:</b></td><td><select name="time"><option value="1">1 time</option><option value="24">1 dag</option><option value="168">7 dage</option><option value="336">14 dage</option><option value="720">30 dage</option><option value="1440">60 dage</option></select></td>
</tr>
<tr>
<input name="user_id" type="hidden" value="<?php echo $usID['user_id']; ?>">
<td colspan="2" align="center"><input type="submit" name="SubmitNew" value="Indsæt Varer på markedspladsen"></td>
</tr>
</form>
</table>
<?php } ?>
Her er galleri_front:
<?php
include_once("dacon.php");
$safari=mysql_query("SELECT * FROM galleri ORDER BY RAND() LIMIT 1");
while($safari_show=mysql_fetch_array($safari)){
?>
<div id="Layer1" style="position:absolute; visibility:hidden; z-index:1; top: 250px; left: 300px;">
<img src="<?php echo ($safari_show['galleri_path']);?>" border="0" vspace="5">
</div>
<a href="#" onMouseOver="MM_showHideLayers('Layer1','','show')" onMouseOut="MM_showHideLayers('Layer1','','hide')">
<img src="<?php echo ($safari_show['galleri_path']);?>" border="0" vspace="5" width="160" alt="Tilfældig galleri billede">
</a>
<br />
<?php echo $safari_show['galleri_text'];?>
<?php
}
?>
