how to store and display photo with mySql and PHP?
Moderator: General Moderators
-
tonguim
- Forum Newbie
- Posts: 21
- Joined: Mon Jun 30, 2003 12:53 pm
- Location: Ouagadougou, BURKINA FASO
- Contact:
how to store and display photo with mySql and PHP?
Good evening (in my country it is 19h00)
I would like to build a directory of my graduate class, with the name, the adresse,..., and the photo of everybody. I would like to use PHP and mySql.
Please, how can i store the photos, and display each one with the informations of its owner? Thanks you very much.
I would like to build a directory of my graduate class, with the name, the adresse,..., and the photo of everybody. I would like to use PHP and mySql.
Please, how can i store the photos, and display each one with the informations of its owner? Thanks you very much.
Have a look at:
Ref : Mig - "My Image Gallery"
http://mig.sourceforge.net/
Ref : Photogallery PHP script
http://tuma.stc.cx/gallery.php
Ref : http://freshmeat.net/search/?q=photo+ga ... filter=183
These should give you an idea for your own application.
Regards,
Ref : Mig - "My Image Gallery"
http://mig.sourceforge.net/
Ref : Photogallery PHP script
http://tuma.stc.cx/gallery.php
Ref : http://freshmeat.net/search/?q=photo+ga ... filter=183
These should give you an idea for your own application.
Regards,
-
pistolfire99
- Forum Commoner
- Posts: 58
- Joined: Thu May 23, 2002 3:18 pm
tonguim:- Do you mean something like this...
http://www.i2l2.com/kpsnatest/zzzdelete0.php
I am also doing something similar for my community, however I am using Dreamweaver MX (30 day full version trial avail. on their website) and I write the scripts by hand, I like the pre-built code snippets within dreamweaver, makes certain tasks easier, that way I can concentrate on core PHP and MySQL and not worry about semi-colons and so on.
BTW, I am not soo good with PHP, sortof intermediate.
Regards,
Pistolfire99
http://www.i2l2.com/kpsnatest/zzzdelete0.php
I am also doing something similar for my community, however I am using Dreamweaver MX (30 day full version trial avail. on their website) and I write the scripts by hand, I like the pre-built code snippets within dreamweaver, makes certain tasks easier, that way I can concentrate on core PHP and MySQL and not worry about semi-colons and so on.
BTW, I am not soo good with PHP, sortof intermediate.
Regards,
Pistolfire99
-
pistolfire99
- Forum Commoner
- Posts: 58
- Joined: Thu May 23, 2002 3:18 pm
tonguim:- Yes, it is. The 'ONLY' limitation is how well you know how to use DreamweaverMX, PHP & MySQL. I dont mean any disrespect, but one can make very complex websites using the above mentioned tools and programming knowledge. If you are familiar with DreamweaverMX and consider yourself an average PHP programmer(like myself), then let me know and I will post a small tutorial.
Check out the above link again, I made some changes.
Good Luck,
Pistolfire99
Check out the above link again, I made some changes.
I am not sure about this, since this depends on a lot of other variables. However I am not storing the images in the database, but only the path to the images.I would like also that the pictures be display as faster it is possible.
Good Luck,
Pistolfire99
It IS possible. If you want someone to do it for you I can be of service to you.tonguim wrote: I thought it was possible to build the directory of my graduate class with PHP and mySql.
Mail me; sami@smx.ca
-
pistolfire99
- Forum Commoner
- Posts: 58
- Joined: Thu May 23, 2002 3:18 pm
That is not entirely true. Dreamweaver is an HTML editor + a lot lot lot more. I also use it as my default PHP editor, since I like the layout and code highlighting and such. I am aware that other editors also have these features, but its just that, this is what I first started with and hence this is what I am sticking with.Darkside:- Dreamweaver is only a HTML program obviusly
tonguim:- You can get a full working copy of DreamweaverMX (30 day trial) from macromedia's website @ http://www.macromedia.com/
Hope this helps,
-
tonguim
- Forum Newbie
- Posts: 21
- Joined: Mon Jun 30, 2003 12:53 pm
- Location: Ouagadougou, BURKINA FASO
- Contact:
It is about the directory i would like to create: i would like to display in a table the photo of each person with beside some informations about him, like name, adress, country etc ... . I wrote a code but it doesn't give me any results; please can you help me to make the following code gives me the results i hope? Below, my code:
Thank you. 
Code: Select all
<?
require ("gtfglobals.php"); // script that contains the hostname, password, database name and table name
echo"<td align = "center"> <h2>Directory of the 4th graduate class of the Adventist University Cosendai</h2></pre>";
echo"<table width=100% border=1 bgcolor=white bordercolor="black" >";
echo"<tr width=100% bgcolor="silver"><td colspan=$colonspan align="center"><font size=2 color=#330099 face="arial black"> $reponse </font></td></tr>";
echo"<tr width=100% bgcolor=#CCCCCC><td width=10% align="center"><b>Photo</<small></b></td><td width=25% align="center"><b><small>Nom(s) et Prénom(s)</small></b></td><td width=20% align="center"><b><small>Adresse</small></b></td><td width=10% align="center"><b><small>Pays</small></b></td><td width=20% align="center"><b><small>Intérêts</small></b></td><td width=30% align="center"><b><small>Projets</small></b></td></b></tr>";
$searchStmt ="SELECT * from $nomTable";
while ($var=@mysql_fetch_array($searchStmt))
{
echo"<tr width=100%>";
$homedir="photo/";
$imagephoto=$varї"login"].".jpg"; //echo"$imagephoto";
// "ouverture" du répertoire
$dir=opendir($homedir);
$trouve="false";
while (($file = readdir($dir))&&($trouve=="false"))
{
//echo"$file";
// comparaison du nom du fichier avec la photo à afficher
//$trouve=1;
if ($file=="$imagephoto")
{
$trouve="true";
$photo=$file;
}
else
{
$trouve="false";
$photo="";
}
}
$nom=$varї"nom"];
$prenom=$varї"prenom"];
$adresse=$varї"adresse"];
$pays=$varї"pays"];
$interets=$varїinterets];
$projets=$varї"projets"];
echo"<td width=10% align="center" border=0><a href="http://lombila.univ-ouaga.bf/editphp/aff_image.php?photo=$photo&nom=$nom&prenom=$prenom&adresse=$fadresse&pays=$pays&sinterets=$interets&projets=$projets"><img src="photo/$photo" width=75 height=75 align="left" border=0></a></td>";
echo"<td width=25% align="center" border=0 bgcolor=$couleur1>";
echo"<b><small>$nom $prenom</small></b> ";echo"</td>";
echo"<td width=20% align="center" border=0 bgcolor=$couleur1>";
echo"<b><small>$adresse </b></small>";echo"</td>";
echo"<td width=10% align="center" border=0 bgcolor=$couleur1>";
echo"<b><small> $pays</small></b></td>";
echo"<td width=20% align="center" border=0 bgcolor=$couleur1>";
echo"<b><small> $interests=$interets</small></b></td>";
echo"<td width=30% align="center" border=0 bgcolor=$couleur1>";
echo"<b><small> $projets=$projets</small></b></td>";
// fin de l'affichage
closedir($dir);
}
?>