Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/02/2006, 16:53
Avatar de arko
arko
 
Fecha de Ingreso: octubre-2005
Ubicación: Sevilla (España)
Mensajes: 79
Antigüedad: 18 años, 6 meses
Puntos: 0
como puedo ejecutar esto?

Hola a todos tengo un script con un instalador... pero cuando ejecuto el instalador no crea las tablas... como podria instalarlo a mano?

dejo el code:
Código PHP:
<?
include "./config.php";

if (
$create){
    
$sql "CREATE TABLE `$table` (
      `id` int(11) NOT NULL auto_increment,
      `email` varchar(255) NOT NULL default '',
      `aim` varchar(20) NOT NULL default '',
      `icq` varchar(20) NOT NULL default '',
      `yahoo` varchar(255) NOT NULL default '',
      `homepage` varchar(255) NOT NULL default '',
      `vote_a` int(11) NOT NULL default '0',
      `vote_b` int(11) NOT NULL default '0',
      `vote_c` int(11) NOT NULL default '0',
      `vote_d` int(11) NOT NULL default '0',
      `vote_e` int(11) NOT NULL default '0',
      `picfile` varchar(255) NOT NULL default '',
      `dt` datetime NOT NULL default '0000-00-00 00:00:00',
      PRIMARY KEY  (`id`)
    ) TYPE=MyISAM AUTO_INCREMENT=1 ;"
;
    
$result mysql_query($sql) or die("Failed: $sql - ".mysql_error());
    print 
"The MySQL table <b>$table</b> has been created and PhotoRate is ready for use! I highly suggest that you now delete <b>create_table.php</b> before you continue. :)";
    exit;

}
?>

<p>This script will automatically create the MySQL tables for PhotoRate. <b>You 
  MUST edit config.php before this script can be run</b>. The 'Create Table' button 
  will appear below if you've successfully given all the info needed to do this. 
  Please review the info below just to be sure:</p>
<p>Database Host: <? print $sqlhost?><br>
  Database Login: <? print $sqllogin?><br>
  Database Password: <? print $sqlpass?><br>
  Database Name: <? print $sqldb?><br>
  MySQL Table Name: 
  <? print $table?>
  <br>
  <br>
  <br>
  If this is all correct, click the 'Create Table' button below. If the button 
  does not show below, it's because one of these fields are empty.</p>
<?
if ($sqlhost && $sqllogin && $sqlpass && $sqldb && $table)print "<form name='form1' method='post' action='create_table.php'>
  <div align='center'>
    <input type='hidden' name='create' value='1'>
    <input type='submit' value='Create Table!'>
  </div>
</form>"
;
?>

Saludos
__________________
Lalala Estudio| Diseño y programación web.

Si buscas con quien aprender, o con quien formar un grupo de trabajo, cuenta conmigo. Contacta ;)