![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
23/03/2009, 07:20
|
| | Fecha de Ingreso: mayo-2003
Mensajes: 312
Antigüedad: 21 años, 8 meses Puntos: 2 | |
Ayuda con FWRITE Gente,
No puedo lograr escribir correctamente en un archivo PHP un codigo PHP.
Ej:
$datosar = "archivo.php";
$ar=fopen("$datosar","w+");
fputs($ar,"<?include(conex.php);");
fputs($ar,"$sql = 'select * from usuarios where tema = juan';");
fputs($ar,"$result = mysql_query($sql);");
fputs($ar,"if($row = mysql_fetch_array($result))");
fputs($ar,"{");
fputs($ar,"$sql = 'update temario SET leccion = 1 where tema = juan';");
fputs($ar,"mysql_query($sql);");
fputs($ar,"};");
fclose($datosar);
Si alguien me ayuda, estaria MAS que agradecido.
El resultado final del archivo PHP, no me queda como quiero. Por ende, no se ejecuta. |