Foros del Web » Programando para Internet » PHP »

radio button language mysql database

Estas en el tema de radio button language mysql database en el foro de PHP en Foros del Web. Table 'u380150093_soro.carta_' doesn't exist Código PHP: <?php  if (! function_exists ( "GetSQLValueString" )) { function  GetSQLValueString ( $theValue ,  $theType ,  $theDefinedValue  =  "" ,  $theNotDefinedValue  =  ...
  #1 (permalink)  
Antiguo 24/01/2014, 06:05
 
Fecha de Ingreso: abril-2013
Mensajes: 39
Antigüedad: 11 años
Puntos: 0
radio button language mysql database

Table 'u380150093_soro.carta_' doesn't exist


Código 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")) {
    
$tabla "carta_".$_POST[lang];
  
$insertSQL sprintf("INSERT INTO ".$tabla."(nombre, precio, categoria) VALUES (%s, %s, %s)",
                       
GetSQLValueString($_POST['nombre'], "text"),
                       
GetSQLValueString($_POST['precio'], "double"),
                       
GetSQLValueString($_POST['categoria'], "text"));

  
mysql_select_db($database_word_demo$word_demo);
  
$Result1 mysql_query($insertSQL$word_demo) or die(mysql_error());

  
$insertGoTo "../../../wp-admin/admin.php?page=options-platos" ;
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$insertGoTo .= (strpos($insertGoTo'?')) ? "&" "?";
    
$insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  
header(sprintf("Location: %s"$insertGoTo));
}
?>
  #2 (permalink)  
Antiguo 24/01/2014, 06:49
Avatar de pablor21  
Fecha de Ingreso: noviembre-2008
Ubicación: Montevideo - Uruguay
Mensajes: 197
Antigüedad: 15 años, 5 meses
Puntos: 13
Respuesta: radio button language mysql database

Lo que está pasando es que no está tomando el valor de $_POST[lang], probablemente es porque no le pusiste las comillas al identificador, debería ser $_POST['lang']

Saludos
__________________
Desarrolloador Freelance - http://www.mvdit.com.uy
  #3 (permalink)  
Antiguo 27/01/2014, 03:29
 
Fecha de Ingreso: abril-2013
Mensajes: 39
Antigüedad: 11 años
Puntos: 0
Respuesta: radio button language mysql database

lang funciona todos bien, Muchos gracias

Etiquetas: button, database, html, language, mysql, radio, select, sql, tabla
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 17:42.