par sausee2005 » 27 juin 2005, 14:38
par sausee2005 » 27 juin 2005, 14:24
par DroP » 27 juin 2005, 14:21
<? require('conf.php') ?><strong><font size="1.8" face="Verdana, Arial, Helvetica, sans-serif">Bien modifier</font></strong><? mysql_select_db("$base", mysql_connect("$hote", "$log", "$pass")) or die ("fe chier"); mysql_query("UPDATE news SET bloc1=".$_POST['bloc1'].", bloc2=".$_POST['bloc2']." WHERE id=".$_GET['code']."") or die ("fe chier"); ?>
par sausee2005 » 27 juin 2005, 14:18
<? require('conf.php') ?><strong><font size="1.8" face="Verdana, Arial, Helvetica, sans-serif">Bien modifier</font></strong><? mysql_select_db("$base", mysql_connect("$hote", "$log", "$pass")) or die ("fe chier"); mysql_query("UPDATE news SET bloc1=".$_POST['bloc1'].", bloc2=".$_POST['bloc2']." WHERE id=".$_GET['code'].";") or die ("fe chier"); ?>
par sausee2005 » 27 juin 2005, 13:17
Notice: Undefined variable: requete in c:\program files\easyphp1-8\www\modifn.php on line 9 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp1-8\www\modifn.php on line 9
http://127.0.0.1/modif2n.php
http://127.0.0.1/index.php?page=modifn&code=78
par DroP » 27 juin 2005, 12:00
par sausee2005 » 27 juin 2005, 11:58
Notice: Undefined index: code in c:\program files\easyphp1-8\www\modif2n.php on line 3
par DroP » 27 juin 2005, 11:57
WHILE ($Resultat!=$Nombre) { $id = mysql_result($Requete,$Nombre,"id"); $bloc1 = mysql_result($Requete,$Nombre,"bloc1"); $bloc2 = mysql_result($Requete,$Nombre,"bloc2"); $Nombre++; }
$r = mysql_fetch_array($requete); $id = $r["id"]; $bloc1 = $r["bloc1"]; $bloc2 = $r["bloc2"];
par DroP » 27 juin 2005, 11:55
par sausee2005 » 27 juin 2005, 11:50
<table align="center" border="1"> <tr> <td valign="top"> <p align="center"><font face="Comic Sans ms">News :</font></p> </td> </tr> <tr> <td> <p><font face="Comic Sans ms"> <BR> <center><font size="4"><b>L'espace News !</b></font></center><br><br><br> <table align=center border="1"> <tr> <td valign=top> <?php require('conf.php');//Inclure les paramètres conf $c1 = @mysql_connect("$hote","$log","$pass") or die("IMP TO CONNECT");//Connexion à SQL @mysql_select_db("$base",$c1) or die("selection impossible"); $sql1 = "select * from news order by id desc"; //"select * from promotion order by id desc limit 15"; //Afichage des promotion, vous pouvez changé limit 5 par limit 10 ou autre.<br> //Limit 2 limite à 2promotion par pages, 5, à 5news par page. if($p1 = @mysql_unbuffered_query($sql1,$c1)){ while($data1 = @mysql_fetch_array($p1)){ ?> <table border="1"> <tr> <td> <font size="2"> <? echo $data1['bloc1']; ?></font> <form name="form1" method="post" action="index.php?page=modifn&code=<? echo $data1['id']; ?>"> <div align="center"> <input type="submit" name="Submit" value="Modifier"> </div> </form> <form name="form1" method="post" action="index.php?page=suprimern&code=<? echo $data1['id']; ?>"> <div align="center"> <input type="submit" name="Submit2" value="Suprimer"> </div> </form> </td> </tr> </table> <? } } //Fermeture SQL 2 ?> </td> </tr> </table> <BR><BR><BR> </font></span></p> </td> </tr><tr><td> <p><strong><font color="#000000" size="1.8" face="Verdana, Arial, Helvetica, sans-serif">[ <a href="index.php?page=ajoutn">Ajouter des new</a> ]</font></strong></p> </td> </tr> </table>
par DroP » 27 juin 2005, 11:47
par sausee2005 » 27 juin 2005, 11:45
$Requete = mysql_query("SELECT * FROM news WHERE id=".$_GET['code'].";");
<? require('conf.php') ?> <? mysql_select_db("$base", mysql_connect("$hote", "$log", "$pass")); mysql_query("OPTIMIZE TABLE news"); mysql_query("CHECK TABLE news"); [u]$Requete = mysql_query("SELECT * FROM news WHERE id=".$_GET['code'].";");[/u] $Resultat = mysql_num_rows($Requete); $Nombre = 0; WHILE ($Resultat!=$Nombre) { $id = mysql_result($Requete,$Nombre,"id"); $bloc1 = mysql_result($Requete,$Nombre,"bloc1"); $bloc2 = mysql_result($Requete,$Nombre,"bloc2"); $Nombre++; } echo " <html> <head> <title>Administration de la news $id</title> </head> <body> <form name=form1\ method=\"post\" action=\"modif2n.php\"> <input type='hidden' name='id' value=".$id."> <table width=\"80%\" border=\"1\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td>Bloc1</td> <td><input name=\"bloc1\" type=\"text\" value=\"$bloc1\"></td> </tr> <tr> <td>Bloc2</td> <td><textarea name=\"bloc2\" cols=\"50\" rows=\"10\">$bloc2</textarea></td> </tr> </table> <div align=\"center\"> <input type=\"submit\" name=\"Submit\" value=\"Modifier\"> </div> </form> </body> </html> "; ?>
par DroP » 27 juin 2005, 11:37
par sausee2005 » 27 juin 2005, 11:15
par zeus » 27 juin 2005, 11:06