witajcie
mam swoj autroski silnik i pisze skrypt ktory sam doda mi foty do galerii i problem jest taki ze mam galerie kategorie i w bazie tabli fotki mam id fotki id kategorii nazwe i opis i wszystko sie dodaje aby nie id kategorii i zmienna jest ok ale sie gubi w polecenieu mysql
nie wiem gdzie jest blad prosze o pomoc
zamieszczam wam caly skrypt
z gory dziekuje
<?php
include("../core/sql.php");
include("../core/meta.php");
include("../themes/org/code.php");;
top();
table("Administracja");
if($_SESSION['admin'])
{
$rights = $_SESSION['admin'];
if($rights['site'] > 0)
{
#nawigacja
<a href="Admin-index">Administracja</a> ->
<a href="Admin-index">Zarządzanie działami</a> ->
<a href="Admin-index">Galeria</a> ->
<a href="Admin-index">Przenoszenie fotek</a>
<hr class="sel">
';
#nawigacja end
echo'<table align="center">'; while ($entry = $d->read())
{
if($entry == "." or $entry == "..")
{
}
else
{
$sql=mysql_query("SELECT * FROM galeria WHERE nazwa = '$entry'"); {
$catid = $info['id'];
}
$s = dir('../gallery/'.$entry); $data=date('d.m.Y, H:i'); $dir = $entry;
$opis = "Brak opisu";
mysql_query("INSERT INTO galeria(nazwa, data, katalog, opis)VALUES('$dir', '$data', '$dir', '$opis')"); while ($foty = $s->read())
{
if($foty == "." or $foty == ".." or $foty == "Thumbs.db" or $foty == "album.txt"){}
else {
$urlb = '/gallery/'.$entry.'/' .$foty.'';
$to = $catid;
mysql_query("INSERT INTO foto(kategoria, url)VALUES('$to', '$urlb')"); }
}
$s->close();
echo'</td></tr><tr><td colspan="2"><hr></td></tr>'; }
}
$d->close();
}#rights
else
{
echo'<center><b>Błąd: <font color="maroon">Brak uprawnień</font></b></center>'; }
}#admin
else{
<center><b>Zaloguj się, aby uzyskac dostęp do tej cześci strony</b></center>
';
}
close();
bottom();
?>