Communauté Informatique NDFR.net : Aide à la création d'une console d'administration - Page 2 - Programmation Web (HTML, PHP, ASP, Java, XML, etc.)
Reply
Aide à la création d'une console d'administration
Thread Tools Display Modes
  #16  
Old 09-08-2006, 17:44
wuub's Avatar
wuub wuub is offline
Membre senior
 
Join Date: 13-11-2002
Location: Montpellier
Age: 48
Posts: 552
Send a message via MSN to wuub
C'est le resultat d'un requete SQL : while($loc_data = mysql_fetch_array($rc))
Code:
        elseif($_POST['send'] == 'update') {

        	$path1= "d:/www/.com/img/locations/".$HTTP_POST_FILES['lfile']['name'][0];
			$path2= "d:/www/.com/img/locations/".$HTTP_POST_FILES['lfile']['name'][1];
			$path3= "d:/www/.com/img/locations/".$HTTP_POST_FILES['lfile']['name'][2];
			$path4= "d:/www/.com/img/locations/".$HTTP_POST_FILES['lfile']['name'][3];

			if ($HTTP_POST_FILES['lfile']['name'][0] == NULL) $HTTP_POST_FILES['lfile']['name'][0] = $loc_data['loc_image_01'];
				else copy($HTTP_POST_FILES['lfile']['tmp_name'][0], $path1);

			if ($HTTP_POST_FILES['lfile']['name'][1] == NULL) $HTTP_POST_FILES['lfile']['name'][1] = $loc_data['loc_image_02'];
				else copy($HTTP_POST_FILES['lfile']['tmp_name'][1], $path2);

			if ($HTTP_POST_FILES['lfile']['name'][2] == NULL) $HTTP_POST_FILES['lfile']['name'][2] = $loc_data['loc_image_03'];
				else copy($HTTP_POST_FILES['lfile']['tmp_name'][2], $path3);

			if ($HTTP_POST_FILES['lfile']['name'][3] == NULL) $HTTP_POST_FILES['lfile']['name'][3] = $loc_data['loc_image_04'];
				else copy($HTTP_POST_FILES['lfile']['tmp_name'][3], $path4);

		$sql =
			' UPDATE locations SET
			  loc_ref = "'		.$_POST['loc_ref'].'"
			, loc_type = "'		.$_POST['loc_type'].'"
			, loc_surface = "'	.$_POST['loc_surface'].'"
			, loc_loggia = "'	.$_POST['loc_loggia'].'"
			, loc_loyer = "'	.$_POST['loc_loyer'].'"
			, loc_charges = "'	.$_POST['loc_charges'].' "
			, loc_frais = "'	.$_POST['loc_frais'].'"
			, loc_lieu = "'		.$_POST['loc_lieu'].'"
			, loc_dispo = "'	.$_POST['loc_dispo'].'"
			, loc_image_01 = "' .$HTTP_POST_FILES['lfile']['name'][0].'"
			, loc_image_02 = "' .$HTTP_POST_FILES['lfile']['name'][1].'"
			, loc_image_03 = "' .$HTTP_POST_FILES['lfile']['name'][2].'"
			, loc_image_04 = "' .$HTTP_POST_FILES['lfile']['name'][3].'"
			, loc_details = "'	.$_POST['loc_details'].'"
			WHERE loc_id = "'	.$_POST['loc_id'].'"';
__________________
L'ignorance n'excuse pas la CONNERIE
Reply With Quote
  #17  
Old 09-08-2006, 17:48
fonji fonji is offline
Membre senior
 
Join Date: 01-07-2003
Age: 38
Posts: 1,627
Donne voir la suite de ton code, parce que là je saisis pas trop.

EDIT : nous avons discuté par IM, et j'avais raison de me questionner sur son $loc_data, la boucle était complètement ailleurs, genre rien à voir...
Donc bon, la solution que je lui ai proposé c'est de modifier sa requête sql pour que les champs soient mis à jour seulement si il y a une valeur, au lieu d'aller chercher l'ancienne pour la remettre dans un update...
C'est pas très français mais j'suis à moitié malade hun.

Last edited by fonji; 09-08-2006 at 18:31.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pb création de compte Mail Exchange. TibolouS Windows NT4/2000/2003/2008 Serveur 3 20-01-2009 07:42
Cours de français Benjy Discussions sur le site et/ou le forum 47 01-05-2006 14:47
console d'administration joomla roudoudou Design Web / Graphisme 6 09-01-2006 22:10
Aide pour création de site virus0r Design Web / Graphisme 24 31-05-2004 15:35
Creation de compte Shadow Windows NT4/2000/XP Client 1 16-02-2003 08:44

All times are GMT +2. The time now is 15:07.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.