Foros del Web » Programando para Internet » PHP »

base de datos: phpMyadmin y DW

Estas en el tema de base de datos: phpMyadmin y DW en el foro de PHP en Foros del Web. Que tal amigos? Hago mi primer pregunta en el foro. Estoy programando un gestor de contenidos (/panel). Utilizando DreamWeaver y phpMyadmin En un mismo form ...
  #1 (permalink)  
Antiguo 15/11/2012, 09:19
 
Fecha de Ingreso: octubre-2012
Ubicación: Mendoza
Mensajes: 3
Antigüedad: 11 años, 6 meses
Puntos: 0
base de datos: phpMyadmin y DW

Que tal amigos?
Hago mi primer pregunta en el foro.
Estoy programando un gestor de contenidos (/panel).
Utilizando DreamWeaver y phpMyadmin

En un mismo form se cargan las distintas categorias del sitio, el mismo tiene un "Lista menú" con Categorías un "Campo de txt" para el titulo, un "Área de txt" para la descripción y un Lista menú para seleccionar una imagen y un "botón" enviar.

El problema es que necesito seleccionar barias imágenes de la base por que las mismas alimentaran un light box por categoria.

Desde ya gracias!
  #2 (permalink)  
Antiguo 15/11/2012, 12:36
Avatar de h2swider  
Fecha de Ingreso: julio-2007
Ubicación: Ciudad de Buenos Aires
Mensajes: 932
Antigüedad: 16 años, 8 meses
Puntos: 194
Respuesta: base de datos: phpMyadmin y DW

Intenta mostrarnos el código que tienes hasta ahora para poder darnos una mejor idea.
__________________
Codifica siempre como si la persona que finalmente mantedra tu código sea un psicópata violento que sabe donde vives
  #3 (permalink)  
Antiguo 15/11/2012, 16:47
 
Fecha de Ingreso: octubre-2012
Ubicación: Mendoza
Mensajes: 3
Antigüedad: 11 años, 6 meses
Puntos: 0
Respuesta: base de datos: phpMyadmin y DW

Gracias por tu pronta respuesta h2swider!

Lo que necesito es que en la parte donde esta el ListMenu se cargen multiples imagenes, las cuales alimentaran un lightbox.

el codigo php entre <head></head> es el siguiente:


<?php require_once('../Connections/conectame.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO tipologia (titulo, descripcion, img) VALUES (%s, %s, %s)",
GetSQLValueString($_POST['titulo'], "text"),
GetSQLValueString($_POST['descripcion'], "text"),
GetSQLValueString($_POST['img'], "text"));

mysql_select_db($database_conectame, $conectame);
$Result1 = mysql_query($insertSQL, $conectame) or die(mysql_error());

$insertGoTo = "categoriaUp.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}

mysql_select_db($database_conectame, $conectame);
$query_ver_categoria = "SELECT * FROM categoria ORDER BY categoria DESC";
$ver_categoria = mysql_query($query_ver_categoria, $conectame) or die(mysql_error());
$row_ver_categoria = mysql_fetch_assoc($ver_categoria);
$totalRows_ver_categoria = mysql_num_rows($ver_categoria);
?>



y en el <body> el form:




<form name="form1" method="POST" action="<?php echo $editFormAction; ?>">
<table width="500" border="1">
<tr>
<td>categoria</td>
<td><label for="titulo"></label>
<label for="categoria"></label>
<select name="categoria" id="categoria">
<?php
do {
?>
<option value="<?php echo $row_ver_categoria['categoria']?>"><?php echo $row_ver_categoria['categoria']?></option>
<?php
} while ($row_ver_categoria = mysql_fetch_assoc($ver_categoria));
$rows = mysql_num_rows($ver_categoria);
if($rows > 0) {
mysql_data_seek($ver_categoria, 0);
$row_ver_categoria = mysql_fetch_assoc($ver_categoria);
}
?>
</select></td>
</tr>
<tr>
<td>titulo</td>
<td><label for="textfield2"></label>
<input type="text" name="titulo" id="textfield2"></td>
</tr>
<tr>
<td>descripcion</td>
<td><label for="descripcion"></label>
<textarea name="descripcion" id="descripcion" cols="45" rows="5"></textarea></td>
</tr>
<tr>
<td>imagen</td>
<td><label for="img"></label>
<select name="img" id="img">
<option>img01.jpg</option>
<option>img02.jpg</option>
<option>img03.jpg</option>
<option>img04.jpg</option>
<option>img05.jpg</option>
</select></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" name="button" id="button" value="Enviar"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>

<?php
mysql_free_result($ver_categoria);
?>

Etiquetas: box, dreamweaver, light
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:33.