Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
Mala pomoc, savjet

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
Hrvoje



Joined: 03 Sep 2004
Posts: 132
Location: My office

PostPosted: 11.02.2009 22:24    Post subject: Mala pomoc, savjet Add user to your forum ignore list Reply with quote

Na pocetcima sam php-a...
Imam problem koji ne mogu skuzit na koji nacin radi.
Iz baze dobivam sve podatke u prikazu osim slika!
Trebao bih pomoc oko BLOB-a kako se koristi?
Unaprijed zahvaljujem!

Code:

<?
function pretvoriDatum($mysqlDatum)
{
$tmp=explode("-", $mysqlDatum);
$datum=$tmp[2] . "." . $tmp[1] . "." . $tmp[0];
return $datum;
}
include "config.php";
$sql="SELECT id, ime, prezime, slika, datum FROM test_tablica ORDER BY ime DESC";
if (!$q=mysql_query($sql))
{
echo "greška<br />" . mysql_query();
die();
}
if (mysql_num_rows($q)==0)
{
echo "nema podataka";
} else {
?>
<table width="760" border="0" cellpadding="1" cellspacing="1">
<tr>
<td><b>Ime:</b></td>
<td><b>Prezime:</b></td>
<td><b>Slika:</b></td>
<td><b>Datum:</b></td>

</tr>
<?
while ($redak=mysql_fetch_array($q))
{
?>
<tr>
<td><?=$redak["ime"]?></td>
<td><?=$redak["prezime"]?></td>
<td><?=$redak["slika"]?></td>
<td><?=pretvoriDatum($redak["datum"])?></td>
</tr>
</table>
Back to top
View user's profile Send private message
PaNtHeR



Joined: 17 Sep 2003
Posts: 161

PostPosted: 11.02.2009 23:23    Post subject: Add user to your forum ignore list Reply with quote

Neznam odgovor, ali samo jedan hint. Bolje ti je u bazu spremiti samo putanju slike koju trebaš ili samo ime fajla, jer sa slikama baza vrlo brzo naraste a onda ju je malo tricky selit po serverima kasnije. Znam da želiš naučiti, ali u 5-6 godina PHP web developmenta to nikad nisam koristio Smile

only my 5 cents.

Sretno s PHPom, dobar izbor Wink

_________________
Back to top
View user's profile Send private message Send e-mail
Hrvoje



Joined: 03 Sep 2004
Posts: 132
Location: My office

PostPosted: 13.02.2009 09:25    Post subject: Add user to your forum ignore list Reply with quote

Pogledao sam par primjera, skuzio sam!

Hvala jos jednom
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group